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

Python versions support #77

Merged
merged 3 commits into from
Jul 24, 2023
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
14 changes: 10 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@ jobs:
python:
- '3.8'
- '3.9'
- '3.10'
- '3.11'
django:
- '3.2'
- '4.1'
- '4.2'
exclude:
- python: '3.11'
django: '3.2'

name: Run the test suite (Python ${{ matrix.python }}, Django ${{ matrix.django }})

Expand All @@ -32,16 +37,17 @@ jobs:
python-version: ${{ matrix.python }}

- name: Install dependencies
run: pip install tox tox-gh-actions codecov
run: pip install tox tox-gh-actions

- name: Run tests
run: |
tox
codecov -e TOXENV,DJANGO
run: tox
env:
PYTHON_VERSION: ${{ matrix.python }}
DJANGO: ${{ matrix.django }}

- name: Publish coverage report
uses: codecov/codecov-action@v3

# publish:
# name: Publish package to PyPI
# runs-on: ubuntu-latest
Expand Down
4 changes: 1 addition & 3 deletions djchoices/choices.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
from django.db.models import Case, IntegerField, Value, When
from django.utils.deconstruct import deconstructible

import six

__all__ = ["ChoiceItem", "DjangoChoices", "C"]


Expand Down Expand Up @@ -188,7 +186,7 @@ def __ne__(self, other):
return not (self == other)


class DjangoChoices(six.with_metaclass(DjangoChoicesMeta)):
class DjangoChoices(metaclass=DjangoChoicesMeta):
order = 0
choices = ()
labels = Labels()
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[bdist_wheel]
universal = 1

[isort]
combine_as_imports = true
default_section = THIRDPARTY
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
license="MIT",
description="Sanity for the django choices functionality.",
long_description=readme,
install_requires=["Django>=3.2", "six>=1.13.0"],
test_suite="runtests.get_suite",
install_requires=["Django>=3.2"],
url="https://github.com/bigjason/django-choices",
author="Jason Webb",
author_email="[email protected],[email protected]",
Expand All @@ -29,6 +28,8 @@
"Framework :: Django :: 4.2",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: PyPy",
],
)
7 changes: 5 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tox]
envlist =
py{38,39}-django{32,41,42}
py{38,39,310}-django{32,41,42}
py310-django{41,42}
docs
black
isort
Expand All @@ -10,6 +11,8 @@ skip_missing_interpreters = true
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311

[gh-actions:env]
DJANGO =
Expand All @@ -26,7 +29,7 @@ deps=
commands=
coverage run \
--rcfile={toxinidir}/.coveragerc \
{toxinidir}/setup.py test
{toxinidir}/runtests.py

[testenv:docs]
basepython=python
Expand Down