From 9c31fd98c4362e6f73f279b33b5b2fd7c24fcdc0 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Wed, 25 Oct 2023 02:49:11 +0200 Subject: [PATCH 1/8] Chore: Update .gitignore --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index e537cb7..35bb908 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ env/ +.venv* __pycache__/ .eggs/ *.egg-info/ @@ -10,3 +11,5 @@ __pycache__/ .DS_Store build/ dist/ +.coverage +coverage.xml From f651c4a457f77c20646fd33acd76f07a375c1f55 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Wed, 25 Oct 2023 02:51:04 +0200 Subject: [PATCH 2/8] Modernize: Fix dependencies --- setup.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 5473fbe..08de9e0 100644 --- a/setup.py +++ b/setup.py @@ -29,13 +29,17 @@ def read(path: str) -> str: packages=["pytest_crate"], install_requires=[ "cr8", - "pytest>=4.0", + "crate", + "pytest>=4.0,<8", ], extras_require={ "develop": [ - "pytest-flake8", - "pytest-mypy", - "pytest-isort", + "flake8<3.8", + "mypy<1", + "pytest-cov<5", + "pytest-flake8<2", + "pytest-isort<4", + "pytest-mypy<0.11", ], }, entry_points={ From 99fca663bc7c3edda0d8df9a0336b93bd88ecb48 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Wed, 25 Oct 2023 02:52:48 +0200 Subject: [PATCH 3/8] Modernize: Fix `custom_crate` test case by using more recent CrateDB When using CrateDB 3.2, the test case fails with: SystemExit: CrateDB didn't start in time or couldn't form a cluster. ERROR: Unrecognized VM option 'UseConcMarkSweepGC' --- tests/test_layer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_layer.py b/tests/test_layer.py index 448426d..a7a3940 100644 --- a/tests/test_layer.py +++ b/tests/test_layer.py @@ -4,7 +4,7 @@ @pytest.fixture(scope="session") def custom_crate_a(crate_layer): - yield from crate_layer("crate_a", "3.2.x") + yield from crate_layer("crate_a", "5.4.x") @pytest.fixture(scope="session") From ca34ee426b7759d54b5885339f459d01540e0af2 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Wed, 25 Oct 2023 02:53:42 +0200 Subject: [PATCH 4/8] CI: Migrate from Travis CI to GitHub Actions --- .github/workflows/tests.yml | 69 +++++++++++++++++++++++++++++++++++++ .travis.yml | 15 -------- 2 files changed, 69 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..0a9eb4b --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,69 @@ +--- +name: Tests + +on: + pull_request: ~ + push: + branches: [ master ] + + # Allow job to be triggered manually. + workflow_dispatch: + +# Cancel in-progress jobs when pushing to the same branch. +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} + +jobs: + + tests: + + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: ["ubuntu-20.04"] + python-version: ["3.6", "3.11"] + + env: + OS: ${{ matrix.os }} + PYTHON: ${{ matrix.python-version }} + + name: Python ${{ matrix.python-version }} on OS ${{ matrix.os }} + steps: + + - name: Acquire sources + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + cache: 'pip' + cache-dependency-path: | + setup.cfg + setup.py + + - name: Set up project + run: | + # Install package in editable mode. + pip install --use-pep517 --prefer-binary --editable=.[develop] + + # Needs to be invoked manually upfront. + # https://github.com/python/mypy/issues/11103 + mypy --install-types --non-interactive pytest_crate + + - name: Run linters and software tests + run: | + pytest --cov pytest_crate -vvvs + coverage xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: ./coverage.xml + flags: unittests + env_vars: OS,PYTHON + name: codecov-umbrella + fail_ci_if_error: false diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 44c7852..0000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -dist: xenial # required for python >= 3.7 -language: python -cache: pip -python: - - 3.7 - - 3.8-dev -sudo: - false -install: - - pip install -e ".[develop]" - - pip install pytest-cov -script: - - pytest --cov pytest_crate -vvvs -notifications: - email: false From b1e472050445d5eb69d97dfb2aab58ec66dc8511 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Wed, 25 Oct 2023 03:14:05 +0200 Subject: [PATCH 5/8] Chore: Update project metadata --- setup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 08de9e0..b1b280d 100644 --- a/setup.py +++ b/setup.py @@ -48,13 +48,17 @@ def read(path: str) -> str: ], }, classifiers=[ - "Development Status :: 3 - Alpha", + "Development Status :: 4 - Beta", "Framework :: Pytest", "License :: OSI Approved :: Apache Software License", "Operating System :: Unix", + "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Topic :: Software Development :: Testing", "Topic :: Database", ], From b94d184ddf3203baa95ac09e2c4d64e0ded30c4a Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Wed, 25 Oct 2023 03:37:42 +0200 Subject: [PATCH 6/8] CI: Add Dependabot configuration --- .github/dependabot.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..1626cb6 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 + +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" + + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "monthly" From f5f32e89e69ac684f42ceacead884f84f0506933 Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Thu, 3 Oct 2024 01:30:22 +0200 Subject: [PATCH 7/8] Chore: Trim license file --- LICENSE | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/LICENSE b/LICENSE index 2629a12..d9a10c0 100644 --- a/LICENSE +++ b/LICENSE @@ -174,29 +174,3 @@ of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2018 Centrality Ltd - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - From dd88e33e8a0ba11199e2b565d9c9b4cb2a3b511a Mon Sep 17 00:00:00 2001 From: Andreas Motl Date: Thu, 3 Oct 2024 01:40:13 +0200 Subject: [PATCH 8/8] Sandbox: Fix dependencies by downgrading pip and setuptools ModuleNotFoundError: No module named 'pkg_resources.extern' --- .github/workflows/tests.yml | 6 +++++- requirements-dev.txt | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 requirements-dev.txt diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0a9eb4b..e369489 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -47,8 +47,12 @@ jobs: - name: Set up project run: | + + # Adjust baseline dependencies. + pip install --prefer-binary --upgrade --requirement=requirements-dev.txt + # Install package in editable mode. - pip install --use-pep517 --prefer-binary --editable=.[develop] + pip install --prefer-binary --editable=.[develop] # Needs to be invoked manually upfront. # https://github.com/python/mypy/issues/11103 diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..3abbe14 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,2 @@ +pip<23 +setuptools<70