Skip to content

Commit

Permalink
[fc] Repository: plone.versioncheck
Browse files Browse the repository at this point in the history
Branch: refs/heads/master
Date: 2023-04-14T16:04:17+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.versioncheck@5774bd8

Ignore invalid versions.

Needed for `setuptools` 66 and higher when checking a package that has invalid versions on PyPI.
Fixes plone/plone.versioncheck#52.

For example it fails on parsing `collective.recipe.template` because it has a version `1.4dev-r93307`.
See https://pypi.org/simple/collective-recipe-template/

Files changed:
M CHANGES.rst
M src/plone/versioncheck/pypi.py
Repository: plone.versioncheck

Branch: refs/heads/master
Date: 2023-04-14T16:26:22+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.versioncheck@98b9d9e

Fix linting

Files changed:
M setup.cfg
M setup.py
M src/plone/versioncheck/analyser.py
M src/plone/versioncheck/formatter.py
M src/plone/versioncheck/utils.py
M tox.ini
Repository: plone.versioncheck

Branch: refs/heads/master
Date: 2023-04-14T16:38:27+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: plone/plone.versioncheck@887051e

Add classifiers for Python 3.8-3.11.

Files changed:
M setup.py
M tox.ini
Repository: plone.versioncheck

Branch: refs/heads/master
Date: 2023-04-15T10:34:35+02:00
Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com>
Commit: plone/plone.versioncheck@79b4290

Merge pull request #53 from plone/maurits-ignore-invalid-version

Ignore invalid versions

Files changed:
M CHANGES.rst
M setup.cfg
M setup.py
M src/plone/versioncheck/analyser.py
M src/plone/versioncheck/formatter.py
M src/plone/versioncheck/pypi.py
M src/plone/versioncheck/utils.py
M tox.ini
  • Loading branch information
gforcada committed Apr 15, 2023
1 parent 24b97fa commit b7f8040
Showing 1 changed file with 65 additions and 15 deletions.
80 changes: 65 additions & 15 deletions last_commit.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,82 @@
Repository: plonetheme.barceloneta
Repository: plone.versioncheck


Branch: refs/heads/2.x
Date: 2023-04-14T08:03:21+02:00
Author: Peter Mathis (petschki) <peter.mathis@kombinat.at>
Commit: https://github.com/plone/plonetheme.barceloneta/commit/12b1659b11524ed2c83369e493c13c26878687c6
Branch: refs/heads/master
Date: 2023-04-14T16:04:17+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: https://github.com/plone/plone.versioncheck/commit/5774bd8c3dce5adf70884a22308af3dd7b2a8372

Preparing release 2.1.11
Ignore invalid versions.

Needed for `setuptools` 66 and higher when checking a package that has invalid versions on PyPI.
Fixes https://github.com/plone/plone.versioncheck/issues/52.

For example it fails on parsing `collective.recipe.template` because it has a version `1.4dev-r93307`.
See https://pypi.org/simple/collective-recipe-template/

Files changed:
M CHANGES.rst
M src/plone/versioncheck/pypi.py

b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 0253e00..d165d2d 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -4,7 +4,10 @@ Changelog\n 1.7.1 (unreleased)\n ------------------\n \n-- Nothing changed yet.\n+- Ignore invalid versions.\n+ Needed for ``setuptools`` 66 and higher when checking a package that has invalid versions on PyPI.\n+ Fixes `issue 52 <https://github.com/plone/plone.versioncheck/issues/52>`_.\n+ [maurits]\n \n \n 1.7.0 (2019-03-08)\ndiff --git a/src/plone/versioncheck/pypi.py b/src/plone/versioncheck/pypi.py\nindex 0602a35..88b3e04 100644\n--- a/src/plone/versioncheck/pypi.py\n+++ b/src/plone/versioncheck/pypi.py\n@@ -74,7 +74,13 @@ def check(name, version, session): # noqa: C901\n releases = sorted(data["releases"])\n for release in releases:\n # major check (overall)\n- rel_v = parse_version(release)\n+ try:\n+ rel_v = parse_version(release)\n+ except Exception:\n+ # likely pkg_resources.extern.packaging.version.InvalidVersion\n+ # but really any exception can be ignored.\n+ # See https://github.com/plone/plone.versioncheck/issues/52\n+ continue\n if rel_v <= version:\n continue\n rel_vtuple = mmbp_tuple(rel_v)\n'

Repository: plone.versioncheck


Branch: refs/heads/master
Date: 2023-04-14T16:26:22+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: https://github.com/plone/plone.versioncheck/commit/98b9d9e1b09bf10cc4a0a10ac366b15d73967f8f

Fix linting

Files changed:
M setup.cfg
M setup.py
D news/239.bugfix
M src/plone/versioncheck/analyser.py
M src/plone/versioncheck/formatter.py
M src/plone/versioncheck/utils.py
M tox.ini

b"diff --git a/CHANGES.rst b/CHANGES.rst\nindex ec44ef25..c30ceab3 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -9,6 +9,17 @@ Changelog\n \n .. towncrier release notes start\n \n+2.1.11 (2023-04-14)\n+-------------------\n+\n+Bug fixes:\n+\n+\n+- Fix Diazo rule problem with undefined footer_portlets and footer_portlets_count variables.\n+\n+ See: https://community.plone.org/t/error-theme-inherited-from-barceloneta-footer-portlets-count/8455 (#239)\n+\n+\n 2.1.10 (2020-11-11)\n -------------------\n \ndiff --git a/news/239.bugfix b/news/239.bugfix\ndeleted file mode 100644\nindex 6c4a4652..00000000\n--- a/news/239.bugfix\n+++ /dev/null\n@@ -1,3 +0,0 @@\n-Fix Diazo rule problem with undefined footer_portlets and footer_portlets_count variables.\n-\n-See: https://community.plone.org/t/error-theme-inherited-from-barceloneta-footer-portlets-count/8455\ndiff --git a/setup.py b/setup.py\nindex bc272813..10c1f6d0 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -5,7 +5,7 @@\n def read(*rnames):\n return open(os.path.join(os.path.dirname(__file__), *rnames)).read()\n \n-version = '2.1.11.dev0'\n+version = '2.1.11'\n \n long_description = (\n read('README.rst') + '\\n' +\n"
b'diff --git a/setup.cfg b/setup.cfg\nindex c23bfde..ae840bc 100644\n--- a/setup.cfg\n+++ b/setup.cfg\n@@ -27,26 +27,7 @@ norecursedirs =\n xfail_strict = True\n \n [isort]\n-# Plone Import Coding Conventions settings\n-# (see: https://docs.plone.org/develop/styleguide/python.html#about-imports).\n-# For all possible settings on isort see:\n-# http://isort.readthedocs.io/en/latest/#configuring-isort /\n-# https://github.com/timothycrosley/isort/wiki/isort-Settings\n-force_alphabetical_sort = True\n-force_single_line = True\n-\n-# We want two empty lines after import sections\n-lines_after_imports = 2\n-\n-#\n-line_length = 200\n-\n-# We do not want any files skiped in Plone context, so include __init__.py\n-# which would be excluded by default.\n-not_skip =\n- __init__.py\n-\n-skip =\n+profile = plone\n \n [flake8]\n exclude =\ndiff --git a/setup.py b/setup.py\nindex c6864d4..3a38a3e 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -3,7 +3,7 @@\n from setuptools import setup\n \n \n-version = \'1.7.1.dev0\'\n+version = "1.7.1.dev0"\n \n long_description = "{0}\\n\\n{1}".format(\n open("README.rst").read(), open("CHANGES.rst").read()\ndiff --git a/src/plone/versioncheck/analyser.py b/src/plone/versioncheck/analyser.py\nindex cc07111..28eefa4 100644\n--- a/src/plone/versioncheck/analyser.py\n+++ b/src/plone/versioncheck/analyser.py\n@@ -39,7 +39,7 @@ def is_cfgidx_newer(pkginfo, target_idx):\n \n \n def is_cfg_newer(pkginfo):\n- """ checks if one of the cfg is newer\n+ """checks if one of the cfg is newer\n \n returns boolean\n """\ndiff --git a/src/plone/versioncheck/formatter.py b/src/plone/versioncheck/formatter.py\nindex 91a612d..fc105d9 100644\n--- a/src/plone/versioncheck/formatter.py\n+++ b/src/plone/versioncheck/formatter.py\n@@ -1,5 +1,6 @@\n # -*- coding: utf-8 -*-\n from __future__ import print_function\n+\n from collections import OrderedDict\n from fnmatch import fnmatch\n from jinja2 import Environment\ndiff --git a/src/plone/versioncheck/utils.py b/src/plone/versioncheck/utils.py\nindex 4baea92..a089ec0 100644\n--- a/src/plone/versioncheck/utils.py\n+++ b/src/plone/versioncheck/utils.py\n@@ -79,8 +79,7 @@ def requests_session(nocache=False):\n \n \n def find_relative(extend, relative=""):\n- """the base dir or url and the actual filename as tuple\n- """\n+ """the base dir or url and the actual filename as tuple"""\n if "://" in extend:\n parts = list(urlparse(extend))\n path = parts[2].split("/")\n@@ -98,11 +97,11 @@ def find_relative(extend, relative=""):\n \n \n def get_terminal_size():\n- """ getTerminalSize()\n- - get width and height of console\n- - works on linux,os x,windows,cygwin(windows)\n- originally retrieved from:\n- http://stackoverflow.com/questions/566746/how-to-get-console-window-width-in-python\n+ """getTerminalSize()\n+ - get width and height of console\n+ - works on linux,os x,windows,cygwin(windows)\n+ originally retrieved from:\n+ http://stackoverflow.com/questions/566746/how-to-get-console-window-width-in-python\n """\n current_os = platform.system()\n tuple_xy = None\n@@ -120,7 +119,8 @@ def get_terminal_size():\n \n def _get_terminal_size_windows():\n try:\n- from ctypes import windll, create_string_buffer\n+ from ctypes import create_string_buffer\n+ from ctypes import windll\n \n # stdin handle is -10\n # stdout handle is -11\ndiff --git a/tox.ini b/tox.ini\nindex aaf4649..41d160e 100644\n--- a/tox.ini\n+++ b/tox.ini\n@@ -42,13 +42,13 @@ commands =\n coverage xml\n \n [testenv:isort-apply]\n-basepython = python3.6\n+basepython = python3.8\n skip_install = true\n deps =\n isort\n \n commands =\n- isort --apply --recursive {toxinidir}/src {toxinidir}/tests {posargs}\n+ isort src tests setup.py {posargs}\n \n [testenv:autopep8]\n basepython = python3.6\n@@ -61,16 +61,17 @@ commands =\n autopep8 --verbose --in-place --recursive --aggressive --aggressive {toxinidir}/src {toxinidir}/tests setup.py\n docformatter --in-place --recursive {toxinidir}/src {toxinidir}/tests setup.py\n \n-[lint]\n+[testenv:lint]\n skip_install = true\n-basepython = python3.6\n+basepython = python3.8\n \n deps =\n isort\n- black\n+ black==21.12b0\n+ click<8.1\n \n commands =\n- isort --check-only --recursive {toxinidir}/src {toxinidir}/tests setup.py\n+ isort --check-only src tests setup.py\n black --check src tests setup.py\n \n whitelist_externals =\n@@ -87,7 +88,7 @@ commands =\n \n [testenv:release]\n skip_install = true\n-basepython = python3.6\n+basepython = python3.8\n \n deps =\n zest.releaser[recommended]\n'

Repository: plonetheme.barceloneta
Repository: plone.versioncheck


Branch: refs/heads/2.x
Date: 2023-04-14T08:08:12+02:00
Author: Peter Mathis (petschki) <peter.mathis@kombinat.at>
Commit: https://github.com/plone/plonetheme.barceloneta/commit/cbe520a975807a8c3743c99e2066d1c2b17e1e7b
Branch: refs/heads/master
Date: 2023-04-14T16:38:27+02:00
Author: Maurits van Rees (mauritsvanrees) <maurits@vanrees.org>
Commit: https://github.com/plone/plone.versioncheck/commit/887051e6de71a3b314b63d13cb2912d0a048a61c

Back to development: 2.1.12
Add classifiers for Python 3.8-3.11.

Files changed:
M setup.py
M tox.ini

b'diff --git a/setup.py b/setup.py\nindex 3a38a3e..4f07bb2 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -28,6 +28,10 @@\n "Programming Language :: Python :: 3",\n "Programming Language :: Python :: 3.6",\n "Programming Language :: Python :: 3.7",\n+ "Programming Language :: Python :: 3.8",\n+ "Programming Language :: Python :: 3.9",\n+ "Programming Language :: Python :: 3.10",\n+ "Programming Language :: Python :: 3.11",\n "Programming Language :: Python",\n "Topic :: Software Development :: Build Tools",\n "Topic :: Software Development :: Quality Assurance",\ndiff --git a/tox.ini b/tox.ini\nindex 41d160e..953c178 100644\n--- a/tox.ini\n+++ b/tox.ini\n@@ -3,6 +3,11 @@ envlist =\n py27,\n py36,\n py37,\n+ py38,\n+ py39,\n+# These currently fail because they get setuptools 66+:\n+# py310,\n+# py311,\n pypy,\n lint,\n coverage-report,\n'

Repository: plone.versioncheck


Branch: refs/heads/master
Date: 2023-04-15T10:34:35+02:00
Author: Gil Forcada Codinachs (gforcada) <gil.gnome@gmail.com>
Commit: https://github.com/plone/plone.versioncheck/commit/79b429089d42fb15f094047443ac3c39e2c532f5

Merge pull request #53 from plone/maurits-ignore-invalid-version

Ignore invalid versions

Files changed:
M CHANGES.rst
M setup.cfg
M setup.py
M src/plone/versioncheck/analyser.py
M src/plone/versioncheck/formatter.py
M src/plone/versioncheck/pypi.py
M src/plone/versioncheck/utils.py
M tox.ini

b"diff --git a/setup.py b/setup.py\nindex 10c1f6d0..803325e4 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -5,7 +5,7 @@\n def read(*rnames):\n return open(os.path.join(os.path.dirname(__file__), *rnames)).read()\n \n-version = '2.1.11'\n+version = '2.1.12.dev0'\n \n long_description = (\n read('README.rst') + '\\n' +\n"
b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 0253e00..d165d2d 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -4,7 +4,10 @@ Changelog\n 1.7.1 (unreleased)\n ------------------\n \n-- Nothing changed yet.\n+- Ignore invalid versions.\n+ Needed for ``setuptools`` 66 and higher when checking a package that has invalid versions on PyPI.\n+ Fixes `issue 52 <https://github.com/plone/plone.versioncheck/issues/52>`_.\n+ [maurits]\n \n \n 1.7.0 (2019-03-08)\ndiff --git a/setup.cfg b/setup.cfg\nindex c23bfde..ae840bc 100644\n--- a/setup.cfg\n+++ b/setup.cfg\n@@ -27,26 +27,7 @@ norecursedirs =\n xfail_strict = True\n \n [isort]\n-# Plone Import Coding Conventions settings\n-# (see: https://docs.plone.org/develop/styleguide/python.html#about-imports).\n-# For all possible settings on isort see:\n-# http://isort.readthedocs.io/en/latest/#configuring-isort /\n-# https://github.com/timothycrosley/isort/wiki/isort-Settings\n-force_alphabetical_sort = True\n-force_single_line = True\n-\n-# We want two empty lines after import sections\n-lines_after_imports = 2\n-\n-#\n-line_length = 200\n-\n-# We do not want any files skiped in Plone context, so include __init__.py\n-# which would be excluded by default.\n-not_skip =\n- __init__.py\n-\n-skip =\n+profile = plone\n \n [flake8]\n exclude =\ndiff --git a/setup.py b/setup.py\nindex c6864d4..4f07bb2 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -3,7 +3,7 @@\n from setuptools import setup\n \n \n-version = \'1.7.1.dev0\'\n+version = "1.7.1.dev0"\n \n long_description = "{0}\\n\\n{1}".format(\n open("README.rst").read(), open("CHANGES.rst").read()\n@@ -28,6 +28,10 @@\n "Programming Language :: Python :: 3",\n "Programming Language :: Python :: 3.6",\n "Programming Language :: Python :: 3.7",\n+ "Programming Language :: Python :: 3.8",\n+ "Programming Language :: Python :: 3.9",\n+ "Programming Language :: Python :: 3.10",\n+ "Programming Language :: Python :: 3.11",\n "Programming Language :: Python",\n "Topic :: Software Development :: Build Tools",\n "Topic :: Software Development :: Quality Assurance",\ndiff --git a/src/plone/versioncheck/analyser.py b/src/plone/versioncheck/analyser.py\nindex cc07111..28eefa4 100644\n--- a/src/plone/versioncheck/analyser.py\n+++ b/src/plone/versioncheck/analyser.py\n@@ -39,7 +39,7 @@ def is_cfgidx_newer(pkginfo, target_idx):\n \n \n def is_cfg_newer(pkginfo):\n- """ checks if one of the cfg is newer\n+ """checks if one of the cfg is newer\n \n returns boolean\n """\ndiff --git a/src/plone/versioncheck/formatter.py b/src/plone/versioncheck/formatter.py\nindex 91a612d..fc105d9 100644\n--- a/src/plone/versioncheck/formatter.py\n+++ b/src/plone/versioncheck/formatter.py\n@@ -1,5 +1,6 @@\n # -*- coding: utf-8 -*-\n from __future__ import print_function\n+\n from collections import OrderedDict\n from fnmatch import fnmatch\n from jinja2 import Environment\ndiff --git a/src/plone/versioncheck/pypi.py b/src/plone/versioncheck/pypi.py\nindex 0602a35..88b3e04 100644\n--- a/src/plone/versioncheck/pypi.py\n+++ b/src/plone/versioncheck/pypi.py\n@@ -74,7 +74,13 @@ def check(name, version, session): # noqa: C901\n releases = sorted(data["releases"])\n for release in releases:\n # major check (overall)\n- rel_v = parse_version(release)\n+ try:\n+ rel_v = parse_version(release)\n+ except Exception:\n+ # likely pkg_resources.extern.packaging.version.InvalidVersion\n+ # but really any exception can be ignored.\n+ # See https://github.com/plone/plone.versioncheck/issues/52\n+ continue\n if rel_v <= version:\n continue\n rel_vtuple = mmbp_tuple(rel_v)\ndiff --git a/src/plone/versioncheck/utils.py b/src/plone/versioncheck/utils.py\nindex 4baea92..a089ec0 100644\n--- a/src/plone/versioncheck/utils.py\n+++ b/src/plone/versioncheck/utils.py\n@@ -79,8 +79,7 @@ def requests_session(nocache=False):\n \n \n def find_relative(extend, relative=""):\n- """the base dir or url and the actual filename as tuple\n- """\n+ """the base dir or url and the actual filename as tuple"""\n if "://" in extend:\n parts = list(urlparse(extend))\n path = parts[2].split("/")\n@@ -98,11 +97,11 @@ def find_relative(extend, relative=""):\n \n \n def get_terminal_size():\n- """ getTerminalSize()\n- - get width and height of console\n- - works on linux,os x,windows,cygwin(windows)\n- originally retrieved from:\n- http://stackoverflow.com/questions/566746/how-to-get-console-window-width-in-python\n+ """getTerminalSize()\n+ - get width and height of console\n+ - works on linux,os x,windows,cygwin(windows)\n+ originally retrieved from:\n+ http://stackoverflow.com/questions/566746/how-to-get-console-window-width-in-python\n """\n current_os = platform.system()\n tuple_xy = None\n@@ -120,7 +119,8 @@ def get_terminal_size():\n \n def _get_terminal_size_windows():\n try:\n- from ctypes import windll, create_string_buffer\n+ from ctypes import create_string_buffer\n+ from ctypes import windll\n \n # stdin handle is -10\n # stdout handle is -11\ndiff --git a/tox.ini b/tox.ini\nindex aaf4649..953c178 100644\n--- a/tox.ini\n+++ b/tox.ini\n@@ -3,6 +3,11 @@ envlist =\n py27,\n py36,\n py37,\n+ py38,\n+ py39,\n+# These currently fail because they get setuptools 66+:\n+# py310,\n+# py311,\n pypy,\n lint,\n coverage-report,\n@@ -42,13 +47,13 @@ commands =\n coverage xml\n \n [testenv:isort-apply]\n-basepython = python3.6\n+basepython = python3.8\n skip_install = true\n deps =\n isort\n \n commands =\n- isort --apply --recursive {toxinidir}/src {toxinidir}/tests {posargs}\n+ isort src tests setup.py {posargs}\n \n [testenv:autopep8]\n basepython = python3.6\n@@ -61,16 +66,17 @@ commands =\n autopep8 --verbose --in-place --recursive --aggressive --aggressive {toxinidir}/src {toxinidir}/tests setup.py\n docformatter --in-place --recursive {toxinidir}/src {toxinidir}/tests setup.py\n \n-[lint]\n+[testenv:lint]\n skip_install = true\n-basepython = python3.6\n+basepython = python3.8\n \n deps =\n isort\n- black\n+ black==21.12b0\n+ click<8.1\n \n commands =\n- isort --check-only --recursive {toxinidir}/src {toxinidir}/tests setup.py\n+ isort --check-only src tests setup.py\n black --check src tests setup.py\n \n whitelist_externals =\n@@ -87,7 +93,7 @@ commands =\n \n [testenv:release]\n skip_install = true\n-basepython = python3.6\n+basepython = python3.8\n \n deps =\n zest.releaser[recommended]\n'

0 comments on commit b7f8040

Please sign in to comment.