Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic modernizations #5

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2

updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
73 changes: 73 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
env/
.venv*
__pycache__/
.eggs/
*.egg-info/
Expand All @@ -10,3 +11,5 @@ __pycache__/
.DS_Store
build/
dist/
.coverage
coverage.xml
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

26 changes: 0 additions & 26 deletions LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -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.

2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pip<23
setuptools<70
20 changes: 14 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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={
Expand All @@ -44,13 +48,17 @@ def read(path: str) -> str:
],
},
classifiers=[
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
Comment on lines -47 to +51
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package is constantly used on a few projects, so I think it deserves to get the "Beta" status, at least ;], or even a higher ranking.

"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",
],
Expand Down
2 changes: 1 addition & 1 deletion tests/test_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Copy link
Author

@amotl amotl Oct 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: When using CrateDB 3.2 today, the test case fails with:

ERROR: Unrecognized VM option 'UseConcMarkSweepGC'
SystemExit: CrateDB didn't start in time or couldn't form a cluster.

It is probably related to a more recent version of cr8, which does not have the capacity to invoke older versions of CrateDB? Should we take care about it in one way or another?

/cc @mfussenegger, @seut



@pytest.fixture(scope="session")
Expand Down