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

Support Python 3.11 #77

Merged
merged 2 commits into from
May 1, 2022
Merged
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
13 changes: 9 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
version: 2
updates:
- package-ecosystem: pip
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: monthly
time: "03:00"
open-pull-requests-limit: 10
labels:
- "changelog: skip"
- dependencies
- package-ecosystem: github-actions
- "dependencies"
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-minor"
- "version-update:semver-patch"
- package-ecosystem: pip
directory: "/"
schedule:
interval: monthly
time: "03:00"
open-pull-requests-limit: 10
labels:
- dependencies
- "changelog: skip"
- "dependencies"
10 changes: 2 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,12 @@ jobs:
with:
fetch-depth: 0

- name: Cache
uses: actions/cache@v3.0.1
with:
path: ~/.cache/pip
key: deploy-${{ hashFiles('**/setup.py') }}
restore-keys: |
deploy-

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
cache: pip
cache-dependency-path: setup.cfg

- name: Install dependencies
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ on:
# branches to consider in the event; optional, defaults to all
branches:
- main
workflow_dispatch:

jobs:
update_release_draft:
if: github.repository == 'hugovk/norwegianblue'
if: github.repository_owner == 'hugovk'
runs-on: ubuntu-latest
steps:
# Drafts your next release notes as pull requests are merged into "main"
Expand Down
28 changes: 5 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["pypy-3.7", "3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
# Include new variables for Codecov
- { codecov-flag: GHA_Ubuntu, os: ubuntu-latest }
- { codecov-flag: GHA_macOS, os: macos-latest }
- { codecov-flag: GHA_Windows, os: windows-latest }
python-version: ["3.11-dev", "pypy-3.7", "3.7", "3.8", "3.9", "3.10"]
os: [windows-latest, macos-latest, ubuntu-latest]

steps:
- uses: actions/checkout@v3
Expand All @@ -26,21 +21,8 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"

- name: Cache
uses: actions/cache@v3.0.1
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.os }}-${{ matrix.python-version }}-v1-${{
hashFiles('**/setup.py') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.python-version }}-v1-
cache: pip
cache-dependency-path: setup.cfg

- name: Install dependencies
run: |
Expand All @@ -61,5 +43,5 @@ jobs:
- name: Upload coverage
uses: codecov/codecov-action@v2.1.0
with:
flags: ${{ matrix.codecov-flag }}
flags: ${{ matrix.os }}
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
10 changes: 8 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
rev: v2.32.0
hooks:
- id: pyupgrade
args: [--py37-plus]
Expand Down Expand Up @@ -28,7 +28,7 @@ repos:
- id: python-check-blanket-noqa

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.2.0
hooks:
- id: check-merge-conflict
- id: check-toml
Expand All @@ -39,6 +39,12 @@ repos:
rev: v1.20.1
hooks:
- id: setup-cfg-fmt
args: [--max-py-version=3.11]

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 0.5.2
hooks:
- id: tox-ini-fmt

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.2
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ end-of-life dates for a number of products.
### From PyPI

```bash
python -m pip install --upgrade norwegianblue
python3 -m pip install --upgrade norwegianblue
```

### From source

```bash
git clone https://github.com/hugovk/norwegianblue
cd norwegianblue
pip install .
python3 -m pip install .
```

## Example command-line use
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython
keywords =
end-of-life
Expand Down
23 changes: 13 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,37 @@
envlist =
cog
lint
py{37, 38, 39, 310}
pins
py{311, 310, 39, 38, 37}

[testenv]
extras =
tests
commands =
# Unit tests
{envpython} -m pytest --cov norwegianblue --cov tests --cov-report xml {posargs}

# Test runs
norwegianblue --version
norwegianblue --help
eol --version
eol --help

[testenv:cog]
deps = cogapp
commands = cog -Pr README.md
skip_install = true
deps =
cogapp
commands =
cog -Pr README.md

[testenv:lint]
deps = pre-commit
commands = pre-commit run --all-files
passenv =
PRE_COMMIT_COLOR
skip_install = true
passenv = PRE_COMMIT_COLOR
deps =
pre-commit
commands =
pre-commit run --all-files

[testenv:pins]
extras = None
extras =
None
commands_pre =
{envpython} -m pip install -r requirements.txt