From 1165f12eb321cf3ecced9655424d6a376933c23c Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 25 May 2022 09:53:42 +0200 Subject: [PATCH 01/10] Remove Travis config Signed-off-by: Philippe Ombredanne --- .travis.yml | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ea48ceb..0000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -# This is a skeleton Travis CI config file that provides a starting point for adding CI -# to a Python project. Since we primarily develop in python3, this skeleton config file -# will be specific to that language. -# -# See https://config.travis-ci.com/ for a full list of configuration options. - -os: linux - -dist: xenial - -language: python -python: - - "3.6" - - "3.7" - - "3.8" - - "3.9" - -# Scripts to run at install stage -install: ./configure --dev - -# Scripts to run at script stage -script: venv/bin/pytest From c1f70fc7339f6eee99c1b3b8f9a2f43e80a7bc01 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 27 May 2022 08:57:06 +0200 Subject: [PATCH 02/10] Add ScanCode Code of Conduct Signed-off-by: Philippe Ombredanne --- CODE_OF_CONDUCT.rst | 86 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 CODE_OF_CONDUCT.rst diff --git a/CODE_OF_CONDUCT.rst b/CODE_OF_CONDUCT.rst new file mode 100644 index 0000000..590ba19 --- /dev/null +++ b/CODE_OF_CONDUCT.rst @@ -0,0 +1,86 @@ +Contributor Covenant Code of Conduct +==================================== + +Our Pledge +---------- + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our +project and our community a harassment-free experience for everyone, +regardless of age, body size, disability, ethnicity, gender identity and +expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +Our Standards +------------- + +Examples of behavior that contributes to creating a positive environment +include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual + attention or advances +- Trolling, insulting/derogatory comments, and personal or political + attacks +- Public or private harassment +- Publishing others’ private information, such as a physical or + electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +Our Responsibilities +-------------------- + +Project maintainers are responsible for clarifying the standards of +acceptable behavior and are expected to take appropriate and fair +corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, +or reject comments, commits, code, wiki edits, issues, and other +contributions that are not aligned to this Code of Conduct, or to ban +temporarily or permanently any contributor for other behaviors that they +deem inappropriate, threatening, offensive, or harmful. + +Scope +----- + +This Code of Conduct applies both within project spaces and in public +spaces when an individual is representing the project or its community. +Examples of representing a project or community include using an +official project e-mail address, posting via an official social media +account, or acting as an appointed representative at an online or +offline event. Representation of a project may be further defined and +clarified by project maintainers. + +Enforcement +----------- + +Instances of abusive, harassing, or otherwise unacceptable behavior may +be reported by contacting the project team at pombredanne@gmail.com +or on the Gitter chat channel at https://gitter.im/aboutcode-org/discuss . +All complaints will be reviewed and investigated and will result in a +response that is deemed necessary and appropriate to the circumstances. +The project team is obligated to maintain confidentiality with regard to +the reporter of an incident. Further details of specific enforcement +policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in +good faith may face temporary or permanent repercussions as determined +by other members of the project’s leadership. + +Attribution +----------- + +This Code of Conduct is adapted from the `Contributor Covenant`_ , +version 1.4, available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +.. _Contributor Covenant: https://www.contributor-covenant.org From 9acab17814f47ec8104962c4cb310877bb8bbbfa Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 27 May 2022 08:58:37 +0200 Subject: [PATCH 03/10] Improve detection of thirdparty dir Signed-off-by: Philippe Ombredanne --- configure | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/configure b/configure index a52f539..32e02f5 100755 --- a/configure +++ b/configure @@ -52,11 +52,19 @@ CFG_ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" CFG_BIN_DIR=$CFG_ROOT_DIR/$VIRTUALENV_DIR/bin +################################ +# Install with or without and index. With "--no-index" this is using only local wheels +# This is an offline mode with no index and no network operations +# NO_INDEX="--no-index " +NO_INDEX="" + + ################################ # Thirdparty package locations and index handling -# Find packages from the local thirdparty directory -if [ -d "$CFG_ROOT_DIR/thirdparty" ]; then - PIP_EXTRA_ARGS="--find-links $CFG_ROOT_DIR/thirdparty" +# Find packages from the local thirdparty directory if present +THIRDPARDIR=$CFG_ROOT_DIR/thirdparty +if [[ "$(echo $THIRDPARDIR/*.whl)x" != "$THIRDPARDIR/*.whlx" ]]; then + PIP_EXTRA_ARGS="$NO_INDEX --find-links $THIRDPARDIR" fi @@ -182,6 +190,7 @@ while getopts :-: optchar; do esac done + PIP_EXTRA_ARGS="$PIP_EXTRA_ARGS" find_python From 4dc252163e63132d9ae1479d22af728ca1232a31 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Sun, 29 May 2022 22:25:13 +0200 Subject: [PATCH 04/10] Add comment Signed-off-by: Philippe Ombredanne --- etc/scripts/utils_thirdparty.py | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/scripts/utils_thirdparty.py b/etc/scripts/utils_thirdparty.py index 2d6f3e4..53f2d33 100644 --- a/etc/scripts/utils_thirdparty.py +++ b/etc/scripts/utils_thirdparty.py @@ -1678,6 +1678,7 @@ def get_package_version(self, name, version=None): """ if not version: versions = list(self._get_package_versions_map(name).values()) + # return the latest version return versions and versions[-1] else: return self._get_package_versions_map(name).get(version) From 5b62c57ed3f3eaa4836b04e1e25517589a0feb8d Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Fri, 29 Jul 2022 09:01:07 +0200 Subject: [PATCH 05/10] Add missing docstring Signed-off-by: Philippe Ombredanne --- src/commoncode/resource.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/commoncode/resource.py b/src/commoncode/resource.py index 8fecdc1..1da2dc9 100644 --- a/src/commoncode/resource.py +++ b/src/commoncode/resource.py @@ -267,6 +267,10 @@ def __init__( ``max_depth`` is the maximum depth of subdirectories to descend below and including `location`. + + ``paths`` is an optional list of of path strings that extend from the + root ``location``. If provided, the codebase will contain only these + paths. """ self.max_depth = max_depth From 2913de7aedb4eaf1005f50400db1843cbb1e13c2 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Tue, 16 Aug 2022 00:32:13 +0200 Subject: [PATCH 06/10] Drop unused intbitset dep Signed-off-by: Philippe Ombredanne --- setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 02788ee..f9186be 100644 --- a/setup.cfg +++ b/setup.cfg @@ -41,7 +41,6 @@ install_requires = attrs >= 18.1, !=20.1.0 Beautifulsoup4 >= 4.0.0 click >= 6.7, !=7.0 - intbitset >= 2.3.0 requests >= 2.7.0 saneyaml >= 0.5.2 text_unidecode >= 1.0 From 18fba5a30cfb70f9b10745811cef4bdc6eabcdc9 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Aug 2022 18:04:35 +0200 Subject: [PATCH 07/10] Bump requirements Signed-off-by: Philippe Ombredanne --- requirements-dev.txt | 31 ++++++++++++++---------- requirements.txt | 57 +++++++++++++++++++++----------------------- 2 files changed, 46 insertions(+), 42 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 5a2b695..bd08a7b 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,24 +1,31 @@ aboutcode-toolkit==7.0.2 -bleach==4.1.0 +black==22.6.0 +bleach==5.0.1 build==0.7.0 commonmark==0.9.1 -docutils==0.18.1 +docutils==0.19 et-xmlfile==1.1.0 execnet==1.9.0 iniconfig==1.1.1 -jeepney==0.7.1 -keyring==23.4.1 -openpyxl==3.0.9 +isort==5.10.1 +jeepney==0.8.0 +keyring==23.7.0 +mypy-extensions==0.4.3 +openpyxl==3.0.10 +pathspec==0.9.0 pep517==0.12.0 -pkginfo==1.8.2 +pkginfo==1.8.3 +platformdirs==2.5.2 py==1.11.0 -pytest==7.0.1 +pytest==7.1.2 pytest-forked==1.4.0 pytest-xdist==2.5.0 -readme-renderer==34.0 +readme-renderer==35.0 requests-toolbelt==0.9.1 -rfc3986==1.5.0 -rich==12.3.0 +rfc3986==2.0.0 +rich==12.5.1 secretstorage==3.3.2 -tomli==1.2.3 -twine==3.8.0 +tomli==2.0.1 +tqdm==4.64.0 +twine==4.0.1 +typing_extensions==4.3.0 diff --git a/requirements.txt b/requirements.txt index 1d23a05..74a6b09 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,16 +3,16 @@ banal==1.0.6 beautifulsoup4==4.11.1 binaryornot==0.4.4 boolean.py==4.0 -certifi==2021.10.8 -cffi==1.15.0 -chardet==4.0.0 -charset-normalizer==2.0.12 -click==8.0.4 -colorama==0.4.4 +certifi==2022.6.15 +cffi==1.15.1 +chardet==5.0.0 +charset-normalizer==2.1.0 +click==8.1.3 +colorama==0.4.5 construct==2.10.68 -container-inspector==31.0.0 -cryptography==36.0.2 -debian-inspector==30.0.0 +container-inspector==31.1.0 +cryptography==37.0.4 +debian-inspector==31.0.0b1 dockerfile-parse==1.2.0 dparse2==0.6.1 extractcode==31.0.0 @@ -20,35 +20,33 @@ extractcode-7z==16.5.210531 extractcode-libarchive==3.5.1.210531 fasteners==0.17.3 fingerprints==1.0.3 -ftfy==6.0.3 +ftfy==6.1.1 future==0.18.2 gemfileparser==0.8.0 html5lib==1.1 idna==3.3 -importlib-metadata==4.8.3 +importlib-metadata==4.12.0 inflection==0.5.1 intbitset==3.0.1 isodate==0.6.1 -jaraco.functools==3.4.0 +jaraco.functools==3.5.1 javaproperties==0.8.1 -Jinja2==3.0.3 +Jinja2==3.1.2 jsonstreams==0.6.0 license-expression==30.0.0 -lxml==4.8.0 -MarkupSafe==2.0.1 +lxml==4.9.1 +MarkupSafe==2.1.1 more-itertools==8.13.0 normality==2.3.3 -packagedcode-msitools==0.101.210706 -packageurl-python==0.9.9 +packageurl-python==0.10.0 packaging==21.3 parameter-expansion-patched==0.3.1 -patch==1.16 -pdfminer-six==20220506 -pefile==2021.9.3 +pdfminer.six==20220524 +pefile==2022.5.30 pip-requirements-parser==31.2.0 pkginfo2==30.0.0 pluggy==1.0.0 -plugincode==30.0.0 +plugincode==31.0.0b1 ply==3.11 publicsuffix2==2.20191221 pyahocorasick==2.0.0b1 @@ -56,24 +54,23 @@ pycparser==2.21 pygmars==0.7.0 Pygments==2.12.0 pymaven-patch==0.3.0 -pyparsing==3.0.8 +pyparsing==3.0.9 pytz==2022.1 PyYAML==6.0 -rdflib==5.0.0 -regipy==2.3.1 -requests==2.27.1 -rpm-inspector-rpm==4.16.1.3.210404 +rdflib==6.2.0 +requests==2.28.1 saneyaml==0.5.2 six==1.16.0 -soupsieve==2.3.1 +soupsieve==2.3.2.post1 spdx-tools==0.7.0a3 text-unidecode==1.3 toml==0.10.2 typecode==30.0.0 typecode-libmagic==5.39.210531 -urllib3==1.26.9 +typing-extensions==4.3.0 +urllib3==1.26.11 urlpy==0.5 wcwidth==0.2.5 webencodings==0.5.1 -xmltodict==0.12.0 -zipp==3.6.0 +xmltodict==0.13.0 +zipp==3.8.1 From 9cd3f75806a04c5d91d7d1429e4fc880e5e2ea61 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Aug 2022 18:04:52 +0200 Subject: [PATCH 08/10] Update changelog for v31.0.0 Signed-off-by: Philippe Ombredanne --- CHANGELOG.rst | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 66ca009..da60699 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,13 +4,8 @@ Release notes Version (next) ------------------------------ -- Add ``posix_only`` option to ``commoncode.paths.portable_filename`` and - ``commoncode.paths.safe_path``. This option prevents - ``commoncode.paths.portable_filename`` and ``commoncode.paths.safe_path`` from - replacing filenames and punctuation in filenames that are valid on POSIX - operating systems, but not Windows. -Version 31.0.0 - (2022-05-16) +Version 31.0.0 - (2022-08-24) ------------------------------ This is a major version with API-breaking changes in the resource module. @@ -88,6 +83,14 @@ Other changes: The returned directory has a trailing path separator unless with_trail is False. The default is True and the default behaviour is unchanged. +- Add ``posix_only`` option to ``commoncode.paths.portable_filename`` and + ``commoncode.paths.safe_path``. This option prevents + ``commoncode.paths.portable_filename`` and ``commoncode.paths.safe_path`` from + replacing filenames and punctuation in filenames that are valid on POSIX + operating systems, but not Windows. + +- Remove unused intbitset dependency. + Version 30.2.0 - (2022-05-02) ------------------------------ From 63ffe0bb13f799c720cd34bd89d5ffee88e91078 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Aug 2022 18:52:43 +0200 Subject: [PATCH 09/10] Improve test suite Drop Python 3.6 Add Python 3.10 Test on newest Linux, macOS and Windows Signed-off-by: Philippe Ombredanne --- azure-pipelines.yml | 57 +++++++++++++++++++++++++++++++++------------ 1 file changed, 42 insertions(+), 15 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d09482d..cb18051 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,3 +1,4 @@ + ################################################################################ # We use Azure to run the full tests suites on multiple Python 3.x # on multiple Windows, macOS and Linux versions all on 64 bits @@ -6,11 +7,15 @@ jobs: +################################################################################ +# These jobs are using VMs and Azure-provided Pythons 3.8 +################################################################################ + - template: etc/ci/azure-posix.yml parameters: job_name: ubuntu18_cpython image_name: ubuntu-18.04 - python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python_versions: ['3.7', '3.8', '3.9', '3.10'] test_suites: all: venv/bin/pytest -n 2 -vvs @@ -18,7 +23,15 @@ jobs: parameters: job_name: ubuntu20_cpython image_name: ubuntu-20.04 - python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python_versions: ['3.7', '3.8', '3.9', '3.10'] + test_suites: + all: venv/bin/pytest -n 2 -vvs + + - template: etc/ci/azure-posix.yml + parameters: + job_name: ubuntu22_cpython + image_name: ubuntu-22.04 + python_versions: ['3.7', '3.8', '3.9', '3.10'] test_suites: all: venv/bin/pytest -n 2 -vvs @@ -26,7 +39,7 @@ jobs: parameters: job_name: macos1015_cpython image_name: macos-10.15 - python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python_versions: ['3.7', '3.8', '3.9', '3.10'] test_suites: all: venv/bin/pytest -n 2 -vvs @@ -38,11 +51,19 @@ jobs: test_suites: all: venv/bin/pytest -n 2 -vvs + - template: etc/ci/azure-posix.yml + parameters: + job_name: macos12_cpython + image_name: macos-12 + python_versions: ['3.7', '3.8', '3.9', '3.10'] + test_suites: + all: venv/bin/pytest -n 2 -vvs + - template: etc/ci/azure-win.yml parameters: job_name: win2019_cpython image_name: windows-2019 - python_versions: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python_versions: ['3.7', '3.8', '3.9', '3.10'] test_suites: all: venv\Scripts\pytest -n 2 -vvs @@ -64,13 +85,18 @@ jobs: parameters: job_name: ubuntu20_test_all_supported_click_versions image_name: ubuntu-20.04 - python_versions: ['3.6', '3.7', '3.8', '3.9'] + python_versions: ['3.7', '3.8', '3.9', '3.10'] test_suites: - click_versions: for clk_ver in 8.0.1 7.1.2 7.1.1 7.1 6.7; do pip install click==$clk_ver; venv/bin/pytest -vvs tests/test_cliutils_progressbar.py; done + click_versions: | + for clk_ver in 8.1.3 8.1.2 8.1.1 8.1.0 8.0.4 8.0.2 8.0.3 8.0.1 7.1.2 7.1.1 7.1 6.7; + do + pip install click==$clk_ver; + venv/bin/pytest -vvs tests/test_cliutils_progressbar.py; + done ################################################################################ -# Test using a plain pip install to get the latest of all wheels +# Tests using a plain pip install to get the latest of all wheels ################################################################################ @@ -78,22 +104,23 @@ jobs: parameters: job_name: ubuntu20_cpython_latest_from_pip image_name: ubuntu-20.04 - python_versions: ['3.6', '3.7', '3.8', '3.9'] + python_versions: ['3.7', '3.8', '3.9', '3.10'] test_suites: - all: venv/bin/pip install --force-reinstall --upgrade -e . && venv/bin/pytest -n 2 -vvs + all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e . && venv/bin/pytest -n 2 -vvs + - template: etc/ci/azure-win.yml parameters: job_name: win2019_cpython_latest_from_pip image_name: windows-2019 - python_versions: ['3.6', '3.7', '3.8', '3.9'] + python_versions: ['3.7', '3.8', '3.9', '3.10'] test_suites: - all: venv\Scripts\pip install --force-reinstall --upgrade -e . && venv\Scripts\pytest -n 2 -vvs + all: venv\Scripts\pip install --upgrade-strategy eager --force-reinstall --upgrade -e . && venv\Scripts\pytest -n 2 -vvs - template: etc/ci/azure-posix.yml parameters: - job_name: macos1015_cpython_latest_from_pip - image_name: macos-10.15 - python_versions: ['3.6', '3.7', '3.8', '3.9'] + job_name: macos11_cpython_latest_from_pip + image_name: macos-11 + python_versions: ['3.7', '3.8', '3.9', '3.10'] test_suites: - all: venv/bin/pip install --force-reinstall --upgrade -e . && venv/bin/pytest -n 2 -vvs + all: venv/bin/pip install --upgrade-strategy eager --force-reinstall --upgrade -e . && venv/bin/pytest -n 2 -vvs From d2391f4d976f5c1269e2847bd53673498ad77761 Mon Sep 17 00:00:00 2001 From: Philippe Ombredanne Date: Wed, 24 Aug 2022 18:53:25 +0200 Subject: [PATCH 10/10] Drop Python 3.6 Signed-off-by: Philippe Ombredanne --- CHANGELOG.rst | 2 ++ setup.cfg | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index da60699..fb2037d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -10,6 +10,8 @@ Version 31.0.0 - (2022-08-24) This is a major version with API-breaking changes in the resource module. +- Drop support for Python 3.6 + - The Resource has no rid (resource id) and no pid (parent id). Instead we now use internally a simpler mapping of {path: Resource} object. As a result the iteration on a Codebase is faster but this requires more diff --git a/setup.cfg b/setup.cfg index f9186be..faf5636 100644 --- a/setup.cfg +++ b/setup.cfg @@ -35,7 +35,7 @@ packages = find: include_package_data = true zip_safe = false -python_requires = >=3.6 +python_requires = >=3.7 install_requires = attrs >= 18.1, !=20.1.0 @@ -44,7 +44,6 @@ install_requires = requests >= 2.7.0 saneyaml >= 0.5.2 text_unidecode >= 1.0 - typing >=3.6, < 3.7; python_version < "3.7" [options.packages.find]