Skip to content

Commit

Permalink
WIP Move to Poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvoncek committed Nov 1, 2023
1 parent 01a49de commit 6da3e78
Show file tree
Hide file tree
Showing 12 changed files with 2,452 additions and 175 deletions.
49 changes: 13 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ jobs:
build:
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11"]
include:
- python-version: 3.7
tox-py: py37
- python-version: 3.8
tox-py: py38
- python-version: 3.9
Expand All @@ -32,27 +30,23 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: |
python -m venv venv
. venv/bin/activate
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install tox
poetry install
- name: Lint with flake8
run: |
pip install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --ignore=W503
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --ignore=W503
- name: Run tox
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
. venv/bin/activate
tox -e ${{ matrix.tox-py }}
poetry run tox -e ${{ matrix.tox-py }}
- uses: codecov/codecov-action@v1
name: Report code coverage
Expand Down Expand Up @@ -105,7 +99,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]
python-version: [3.8, 3.9, "3.10", "3.11"]
it-backend: [local, s3, gcs, minio, azure, azure-hierarchical]
# IBM not included by default due to lite plan quota being easily exceeded
#it-backend: [local, s3, gcs, minio, ibm, azure]
Expand Down Expand Up @@ -133,11 +127,6 @@ jobs:
cassandra-version: 4.0.0
it-backend: gcs
experimental: false
# explicitly include tests against python 3.7 and one version of cassandra
- python-version: 3.7
cassandra-version: 4.0.0
it-backend: gcs
experimental: false
exclude:
# no tests against trunk
- cassandra-version: 'github:apache/trunk'
Expand All @@ -153,7 +142,6 @@ jobs:
- it-backend: azure-hierarchical
cassandra-version: "3.11.11"
# no tests against non-python3.9, except the explicitly allowed combinations
- python-version: 3.7
- python-version: 3.8
- python-version: "3.10"
- python-version: "3.11"
Expand Down Expand Up @@ -181,23 +169,13 @@ jobs:
with:
java-version: '8.0.252'
architecture: x64
- name: Setup Poetry
uses: snok/install-poetry@v1
- name: Install dependencies
run: |
python -m venv venv
. venv/bin/activate
sudo apt-get remove azure-cli
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-test.txt
poetry install
sudo apt-get remove azure-cli || true
pip install ccm
case '${{ matrix.it-backend }}' in
'azure'|'azure-hierarchical')
echo "No extra requirements for now."
;;
'ibm'|'minio'|'s3')
echo "No extra requirements for now."
;;
esac
- name: Check if integration tests can run
env:
Expand All @@ -224,7 +202,6 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.BUCKET_SECRET }}
run: |
set -e
. venv/bin/activate
if [[ "${{ matrix.it-backend }}" == "ibm" ]];
then
# Prevent awscli from using AWS secrets in case we're running against IBM cloud
Expand Down Expand Up @@ -300,7 +277,7 @@ jobs:
# Move and convert the coverage analysis file to XML
mv tests/integration/.coverage .
coverage xml
poetry run coverage xml
- uses: codecov/codecov-action@v1
name: Report code coverage
Expand Down
4 changes: 2 additions & 2 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ export DH_VIRTUALENV_INSTALL_ROOT = /usr/share

override_dh_virtualenv:
dh_virtualenv \
--extra-pip-arg "--no-cache-dir" \
--python /usr/bin/python3 --preinstall=setuptools==40.3.0 --preinstall=pip==21.3.1 --preinstall=wheel --builtin-venv
--python /usr/bin/python3 --preinstall=setuptools==40.3.0 --preinstall=pip==21.3.1 --preinstall=wheel --builtin-venv \
--preinstall=poetry==1.6.1 --preinstall=dh-poetry==0.2.0 --pip-tool=dh-poetry

override_dh_strip:
dh_strip --no-automatic-dbgsym -X libssh2 -X libssh -X libgssapi_krb5 -X libcrypto -X libkrb5 -X libk5crypto
Expand Down
4 changes: 2 additions & 2 deletions packaging/docker-build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ RUN apt-get update && \
# install dependencies
RUN apt-get update \
&& apt-get install -y \
libffi-dev \
libssl-dev \
libffi-dev \
libssl-dev \
debhelper \
gdebi-core \
gcc \
Expand Down
Loading

0 comments on commit 6da3e78

Please # to comment.