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" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..e369489 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,73 @@ +--- +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: | + + # Adjust baseline dependencies. + pip install --prefer-binary --upgrade --requirement=requirements-dev.txt + + # Install package in editable mode. + pip install --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/.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 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 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. - 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 diff --git a/setup.py b/setup.py index 5473fbe..b1b280d 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={ @@ -44,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", ], 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")