Hello community,
here is the log from the commit of package python-pytest-black for
openSUSE:Factory checked in at 2020-10-08 13:13:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-black (Old)
and /work/SRC/openSUSE:Factory/.python-pytest-black.new.4249 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-black"
Thu Oct 8 13:13:41 2020 rev:4 rq:840074 version:0.3.12
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pytest-black/python-pytest-black.changes
2020-07-08 19:15:13.079580177 +0200
+++
/work/SRC/openSUSE:Factory/.python-pytest-black.new.4249/python-pytest-black.changes
2020-10-08 13:13:59.519270636 +0200
@@ -1,0 +2,7 @@
+Wed Oct 7 13:57:46 UTC 2020 - Marketa Calabkova <[email protected]>
+
+- Update to 0.3.12
+ * Handle verbose include/exclude patterns in pyproject.toml.
+ * Add support for Python 3.8
+
+-------------------------------------------------------------------
Old:
----
pytest-black-0.3.10.tar.gz
New:
----
pytest-black-0.3.12.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pytest-black.spec ++++++
--- /var/tmp/diff_new_pack.LPbjhn/_old 2020-10-08 13:14:00.011271082 +0200
+++ /var/tmp/diff_new_pack.LPbjhn/_new 2020-10-08 13:14:00.011271082 +0200
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-pytest-black
-Version: 0.3.10
+Version: 0.3.12
Release: 0
Summary: Black format checking plugin for pytest
License: MIT
++++++ pytest-black-0.3.10.tar.gz -> pytest-black-0.3.12.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-black-0.3.10/.travis.yml
new/pytest-black-0.3.12/.travis.yml
--- old/pytest-black-0.3.10/.travis.yml 2020-06-29 16:17:40.000000000 +0200
+++ new/pytest-black-0.3.12/.travis.yml 2020-10-05 11:41:50.000000000 +0200
@@ -1,7 +1,10 @@
-sudo: false
language: python
matrix:
include:
+ - python: 3.8
+ env: TOX_ENV=py38
+ - python: 3.7
+ env: TOX_ENV=py37
- python: 3.6
env: TOX_ENV=py36
- python: 3.5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-black-0.3.10/PKG-INFO
new/pytest-black-0.3.12/PKG-INFO
--- old/pytest-black-0.3.10/PKG-INFO 2020-06-29 16:18:09.000000000 +0200
+++ new/pytest-black-0.3.12/PKG-INFO 2020-10-05 11:42:26.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: pytest-black
-Version: 0.3.10
+Version: 0.3.12
Summary: A pytest plugin to enable format checking with black
Home-page: https://github.com/shopkeep/pytest-black
Author: ShopKeep Inc
@@ -49,6 +49,21 @@
You can override default black configuration options by placing a
`pyproject.toml` file in your project directory. See example configuration
[here](https://github.com/ambv/black/blob/master/pyproject.toml).
+
+ Python package management
+ -------------------------
+ For *poetry* to work correctly, include this in your pyproject.toml
configuration file:
+
+ ```
+ [tool.poetry.dev-dependencies]
+ ...
+ black = { version = "*", allow-prereleases = true }
+ ...
+ ```
+
+ This is necessary because at the time of writing all the *black*
releases in PyPI have been tagged as pre-releases (beta code), which breaks
*poetry*'s dependency resolution.
+
+
Testing
-------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-black-0.3.10/README.md
new/pytest-black-0.3.12/README.md
--- old/pytest-black-0.3.10/README.md 2020-06-29 16:17:40.000000000 +0200
+++ new/pytest-black-0.3.12/README.md 2020-10-05 11:41:50.000000000 +0200
@@ -39,6 +39,21 @@
You can override default black configuration options by placing a
`pyproject.toml` file in your project directory. See example configuration
[here](https://github.com/ambv/black/blob/master/pyproject.toml).
+
+Python package management
+-------------------------
+For *poetry* to work correctly, include this in your pyproject.toml
configuration file:
+
+```
+[tool.poetry.dev-dependencies]
+...
+black = { version = "*", allow-prereleases = true }
+...
+```
+
+This is necessary because at the time of writing all the *black* releases in
PyPI have been tagged as pre-releases (beta code), which breaks *poetry*'s
dependency resolution.
+
+
Testing
-------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-black-0.3.10/pytest_black.egg-info/PKG-INFO
new/pytest-black-0.3.12/pytest_black.egg-info/PKG-INFO
--- old/pytest-black-0.3.10/pytest_black.egg-info/PKG-INFO 2020-06-29
16:18:09.000000000 +0200
+++ new/pytest-black-0.3.12/pytest_black.egg-info/PKG-INFO 2020-10-05
11:42:26.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: pytest-black
-Version: 0.3.10
+Version: 0.3.12
Summary: A pytest plugin to enable format checking with black
Home-page: https://github.com/shopkeep/pytest-black
Author: ShopKeep Inc
@@ -49,6 +49,21 @@
You can override default black configuration options by placing a
`pyproject.toml` file in your project directory. See example configuration
[here](https://github.com/ambv/black/blob/master/pyproject.toml).
+
+ Python package management
+ -------------------------
+ For *poetry* to work correctly, include this in your pyproject.toml
configuration file:
+
+ ```
+ [tool.poetry.dev-dependencies]
+ ...
+ black = { version = "*", allow-prereleases = true }
+ ...
+ ```
+
+ This is necessary because at the time of writing all the *black*
releases in PyPI have been tagged as pre-releases (beta code), which breaks
*poetry*'s dependency resolution.
+
+
Testing
-------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-black-0.3.10/pytest_black.py
new/pytest-black-0.3.12/pytest_black.py
--- old/pytest-black-0.3.10/pytest_black.py 2020-06-29 16:17:40.000000000
+0200
+++ new/pytest-black-0.3.12/pytest_black.py 2020-10-05 11:41:50.000000000
+0200
@@ -49,7 +49,12 @@
self.add_marker("black")
try:
with open("pyproject.toml") as toml_file:
- self.pyproject = toml.load(toml_file)["tool"]["black"]
+ settings = toml.load(toml_file)["tool"]["black"]
+ if "include" in settings.keys():
+ settings["include"] = self._re_fix_verbose(settings["include"])
+ if "exclude" in settings.keys():
+ settings["exclude"] = self._re_fix_verbose(settings["exclude"])
+ self.pyproject = settings
except Exception:
self.pyproject = {}
@@ -97,6 +102,17 @@
return False
return re.search(self.pyproject["exclude"], str(self.fspath))
+ def _re_fix_verbose(self, regex):
+ if "\n" in regex:
+ regex = "(?x)" + regex
+ return re.compile(regex)
+
+ def collect(self):
+ """ returns a list of children (items and collectors)
+ for this collection node.
+ """
+ return (self,)
+
class BlackError(Exception):
pass
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-black-0.3.10/tests/test_black.py
new/pytest-black-0.3.12/tests/test_black.py
--- old/pytest-black-0.3.10/tests/test_black.py 2020-06-29 16:17:40.000000000
+0200
+++ new/pytest-black-0.3.12/tests/test_black.py 2020-10-05 11:41:50.000000000
+0200
@@ -96,6 +96,43 @@
result.assert_outcomes(skipped=1, passed=0)
+def test_exclude_folder(testdir):
+ """Assert test is skipped for files in a folder
+ """
+ testdir.makefile(
+ "pyproject.toml",
+ """
+ [tool.black]
+ exclude = '''
+ (
+ /(
+ first_folder
+ | ignore_folder
+ )/
+ )
+ '''
+ """,
+ )
+ p = testdir.makepyfile(
+ """
+ def hello():
+ print("Hello, world!")
+ """
+ )
+ # replace trailing newline (stripped by testdir.makepyfile)
+ p = p.write(p.read() + "\n")
+
+ # Move file into folder that should be excluded
+ ignore_folder = testdir.mkdir("ignore_folder")
+ testdir.run("mv", "test_exclude_folder.py", ignore_folder)
+
+ # Rename pyproject.toml ¯\_(ツ)_/¯
+ testdir.run("mv", "test_exclude_folder.pyproject.toml", "pyproject.toml")
+
+ result = testdir.runpytest("--black")
+ result.assert_outcomes(skipped=1, passed=0)
+
+
def test_include(testdir):
"""Assert test is not skipped if path is included but not excluded
"""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-black-0.3.10/tox.ini
new/pytest-black-0.3.12/tox.ini
--- old/pytest-black-0.3.10/tox.ini 2020-06-29 16:17:40.000000000 +0200
+++ new/pytest-black-0.3.12/tox.ini 2020-10-05 11:41:50.000000000 +0200
@@ -3,7 +3,7 @@
ignore = E501
[tox]
-envlist = py27,py35,py36,py37,flake8
+envlist = py27,py35,py36,py37,py38,flake8
[testenv]
deps = pytest>=3.0