Skip to content

Commit

Permalink
feat: support python 3.10
Browse files Browse the repository at this point in the history
  • Loading branch information
klen committed Oct 20, 2021
1 parent 5f51e5b commit d3e66ad
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ updates:

# Maintain dependencies for Python
- package-ecosystem: "pip"
directory: "/"
directory: "/requirements"
labels:
- dependencies
- autosquash
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
if: github.event.workflow_run.conclusion == 'success'
steps:

- uses: actions/checkout@v2.3.4
- uses: actions/checkout@main
with:
fetch-depth: 5

- uses: actions/setup-python@v2.2.2
- uses: actions/setup-python@main
with:
python-version: 3.9

Expand All @@ -27,7 +27,7 @@ jobs:
python setup.py bdist_wheel
python setup.py sdist
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@main
with:
name: dist
path: dist
Expand All @@ -38,7 +38,7 @@ jobs:
steps:

- name: Download a distribution artifact
uses: actions/download-artifact@v2
uses: actions/download-artifact@main
with:
name: dist
path: dist
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ['3.7', '3.8', '3.9', '3.10']

steps:
- name: Checkout changes
uses: actions/checkout@v2
uses: actions/checkout@main

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -33,7 +33,7 @@ jobs:
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v2.1.6
uses: actions/cache@main
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('setup.cfg') }}
Expand Down
4 changes: 4 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2021-10-20 klen (unreleased)

* Support python 3.10

2021-01-20 klen

* Drop python2 support (python 3.8 ia required)
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
include LICENSE
include MANIFEST.in
include README.rst
include requirements.txt

recursive-include peewee_migrate *
recursive-include requirements *.txt

recursive-exclude * __pycache__
recursive-exclude * *.py[co]
recursive-exclude * *.orig
recursive-exclude * *.orig
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ major:
# Development
# =============

$(VIRTUAL_ENV): setup.cfg
$(VIRTUAL_ENV): requirements/requirements.txt requirements/requirements-tests.txt
@[ -d $(VIRTUAL_ENV) ] || python -m venv $(VIRTUAL_ENV)
@$(VIRTUAL_ENV)/bin/pip install -e .[tests,build]
@touch $(VIRTUAL_ENV)
Expand Down
3 changes: 3 additions & 0 deletions requirements/requirements-tests.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pytest
pytest-mypy
psycopg2-binary
3 changes: 3 additions & 0 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
click >= 6.7
peewee >= 3.3.3
cached_property; python_version<'3.8'
46 changes: 16 additions & 30 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,44 +13,30 @@ license = MIT
license_files = LICENSE
keywords = peewee, migrations, orm
project_urls =
Documentation = https://github.com/klen/peewee_migrate
Source code = https://github.com/klen/peewee_migrate
Issue tracker = https://github.com/klen/peewee_migrate/issues
Documentation = https://github.com/klen/peewee_migrate
Source code = https://github.com/klen/peewee_migrate
Issue tracker = https://github.com/klen/peewee_migrate/issues
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Topic :: Software Development :: Libraries :: Python Modules
Topic :: Utilities
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Topic :: Software Development :: Libraries :: Python Modules
Topic :: Utilities

[options]
packages = peewee_migrate
include_package_data = True
python_requires = >= 3.7
zip_safe = False
install_requires =
click >= 6.7
peewee >= 3.3.3
cached_property; python_version<'3.8'

[options.entry_points]
console_scripts =
pw_migrate = peewee_migrate.cli:cli

[options.extras_require]
tests =
pytest
pytest-mypy
psycopg2-binary
build =
bump2version
twine
wheel
pw_migrate = peewee_migrate.cli:cli

[tool:pytest]
addopts = -xsv --mypy
Expand All @@ -62,12 +48,12 @@ ignore = D203,D213,D401
ignore = D

[tox:tox]
envlist = py37,py38,py39
envlist = py37,py38,py39,py310

[testenv]
deps = -e .[tests]
commands =
pytest tests
pytest tests

[mypy]
ignore_missing_imports = True
27 changes: 26 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
"""Setup the package."""


# Parse requirements
# ------------------
import pkg_resources
import pathlib


def parse_requirements(path: str) -> 'list[str]':
with pathlib.Path(path).open() as requirements:
return [str(req) for req in pkg_resources.parse_requirements(requirements)]


# Setup package
# -------------

from setuptools import setup


setup()
setup(
install_requires=parse_requirements('requirements/requirements.txt'),
extras_require={
'tests': parse_requirements('requirements/requirements-tests.txt'),
'build': ['bump2version', 'wheel'],
}
)

# pylama:ignore=E402,D

0 comments on commit d3e66ad

Please sign in to comment.