Skip to content

Commit

Permalink
chg: update supported python and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
lindsay-stevens committed Mar 27, 2024
1 parent 50c420d commit d3c4368
Show file tree
Hide file tree
Showing 20 changed files with 139 additions and 313 deletions.
31 changes: 11 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: ['3.8']
python: ['3.12']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand All @@ -24,31 +24,22 @@ jobs:
id: python-cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ matrix.os }}-${{ matrix.python }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev_requirements.pip') }}
key: ${{ env.pythonLocation }}-${{ matrix.os }}-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies.
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -r dev_requirements.pip
pip install -r docs/docs_requirements.pip
pip install -e[docs] .
pip list
# Build.
- name: Build sdist and wheel.
run: |
pip install wheel
python bin/clean_for_build.py
python setup.py sdist bdist_wheel
# Publish.
- name: Publish release to PyPI with twine
# Build and publish.
- name: Publish release to PyPI
if: success()
run: |
pip install twine
twine upload dist/pyodk-*-py3-none-any.whl dist/pyodk-*.tar.gz
pip install flit==3.9.0
flit --debug publish --no-use-vcs
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

# Publish docs.
- name: Publish docs to gh-pages
Expand Down
49 changes: 17 additions & 32 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: ['3.8']
python: ['3.12']
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand All @@ -22,35 +22,29 @@ jobs:
id: python-cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ matrix.os }}-${{ matrix.python }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev_requirements.pip') }}
key: ${{ env.pythonLocation }}-${{ matrix.os }}-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies.
run: |
python -m pip install --upgrade pip
pip install -e .
pip install -r dev_requirements.pip
pip install -e .[dev]
pip list
# Linters.
- run: black pyodk tests bin --check --diff
- run: isort pyodk tests bin --check-only --diff
- run: flake8 pyodk tests bin
- run: pycodestyle pyodk tests bin
# Linter.
- run: ruff check pyodk tests --no-fix
- run: ruff format pyodk tests --diff

test:
runs-on: ${{ matrix.os }}
strategy:
# Run all matrix jobs even if one of them fails.
fail-fast: false
matrix:
python: ['3.8']
python: ['3.12']
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: windows-latest
windows_nose_args: --traverse-namespace ./tests
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

Expand All @@ -60,32 +54,23 @@ jobs:
id: python-cache
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ matrix.os }}-${{ matrix.python }}-${{ hashFiles('setup.py') }}-${{ hashFiles('dev_requirements.pip') }}
key: ${{ env.pythonLocation }}-${{ matrix.os }}-${{ matrix.python }}-${{ hashFiles('pyproject.toml') }}
- name: Install dependencies.
run: |
python -m pip install --upgrade pip
pip install -r dev_requirements.pip
pip install -r docs/docs_requirements.pip
pip install -e .[dev]
pip list
# Tests.
- name: Run tests
env:
PYODK_CONFIG_FILE: ${{ github.workspace }}/tests/resources/.pyodk_config.toml
run: nosetests -v -v ${{ matrix.windows_nose_args }}
run: python -m unittest --verbose

# Build and Upload.
- name: Build sdist and wheel.
if: success()
run: |
pip install wheel
python bin/clean_for_build.py
python setup.py sdist bdist_wheel
# Check.
- name: Check dist with twine
run: |
pip install twine
twine check dist/*
pip install flit==3.9.0
flit --debug build --no-use-vcs
- name: Upload sdist and wheel.
if: success()
uses: actions/upload-artifact@v3
Expand Down
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This library aims to make common data analysis and workflow automation tasks as

## Install

The currently supported Python version for `pyodk` is 3.8.
The currently supported Python version for `pyodk` is 3.12.

### From pip

Expand Down Expand Up @@ -155,26 +155,20 @@ See issues for additions to `pyodk` that are under consideration. Please file ne
Install the source files as described above, then:

```bash
pip install -r dev_requirements.pip
pip install -e .[dev]
```

You can run tests with:

```bash
nosetests
```

On Windows, use:

```bash
nosetests -v -v --traverse-namespace ./tests
python -m unittest
```

## Release

1. Run all linting and tests.
1. Draft a new GitHub release with the list of merged PRs.
1. Check out a release branch from latest upstream master.
1. Update `pyodk/__version__.py` with the new release version number.
1. Update `pyproject.toml` and `pyodk/__version__.py` with the new release version number.
1. Commit, push the branch, and initiate a pull request. Wait for tests to pass, then merge the PR.
1. Tag the release and it will automatically be published (see `release.yml` actions file).
Empty file removed bin/__init__.py
Empty file.
24 changes: 0 additions & 24 deletions bin/clean_for_build.py

This file was deleted.

43 changes: 0 additions & 43 deletions bin/pre_commit.py

This file was deleted.

8 changes: 0 additions & 8 deletions dev_requirements.in

This file was deleted.

38 changes: 0 additions & 38 deletions dev_requirements.pip

This file was deleted.

5 changes: 0 additions & 5 deletions docs/docs_requirements.in

This file was deleted.

69 changes: 0 additions & 69 deletions docs/docs_requirements.pip

This file was deleted.

1 change: 0 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ plugins:
- search
- mkdocstrings:
enabled: !ENV [ENABLE_MKDOCSTRINGS, true]
custom_templates: templates
default_handler: python
handlers:
python:
Expand Down
Loading

0 comments on commit d3c4368

Please sign in to comment.