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

Use pure pyproject.toml setup for packaging #155

Merged
merged 2 commits into from
Feb 12, 2024
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
6 changes: 1 addition & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ env:

jobs:
python-django:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
Expand All @@ -34,12 +33,9 @@ jobs:
exclude:
- { django-version: '3.2', python-version: '3.11' }
- { django-version: '3.2', python-version: '3.12' }
- { django-version: '4.1', python-version: '3.6' }
- { django-version: '4.1', python-version: '3.7' }
- { django-version: '4.1', python-version: '3.12' }
- { django-version: '4.2', python-version: '3.6' }
- { django-version: '4.2', python-version: '3.7' }
bittner marked this conversation as resolved.
Show resolved Hide resolved
- { django-version: '5.0', python-version: '3.6' }
- { django-version: '5.0', python-version: '3.7' }
- { django-version: '5.0', python-version: '3.8' }
- { django-version: '5.0', python-version: '3.9' }
Expand Down
7 changes: 4 additions & 3 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
Release History
---------------

1.4.1 (unreleased)
1.5.0 (unreleased)
++++++++++++++++++

**Features and Improvements**

- Migrate packaging from ``setup.py`` to pure ``pyproject.toml``.
- Add instructions to measure test coverage to the documentation
- Cover Python 3.9 and 3.10 and Django 3.2 and 4.0, drop Python 3.5 and Django 2.2 and 3.0 support
- Bump Behave requirement to 1.2.7 (allows option to change the Behave TestRunner)
- Cover Python 3.9 to 3.12 and Django 3.2, 4.x and 5.0, drop Python 3.5, 3.6 and Django 2.2 and 3.0 support
- Bump Behave requirement to 1.2.7.dev3/4/5 (allows TOML support and option to change the Behave TestRunner)
- New option to change the Django TestRunner

1.4.0 (2020-06-15)
Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include LICENSE
include README.rst
include requirements.txt
recursive-include behave_django *.py
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Version Support
---------------

*behave-django* is `tested against`_ the officially supported combinations of
Python and Django (Django 3.2, 4.1, 4.2, 5.0 on Python 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12).
Python and Django (Django 3.2, 4.1, 4.2, 5.0 on Python 3.7, 3.8, 3.9, 3.10, 3.11, 3.12).
bittner marked this conversation as resolved.
Show resolved Hide resolved

*behave-django* requires a few newer features of *behave* and hence installs
a recent unreleased version of `behave`_ as a dependency.
Expand Down
2 changes: 1 addition & 1 deletion behave_django/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Behave BDD integration for Django"""

__version__ = '1.4.0'
__version__ = '1.5.0'
75 changes: 75 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,63 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=64"]

[project]
name = "behave-django"
dynamic = ["version"]
description = "Behave BDD integration for Django"
readme = "README.rst"
license = {file = "LICENSE"}
authors = [
{name = "Mitchel Cabuloy", email = "mixxorz@gmail.com"},
{name = "Peter Bittner", email = "django@bittner.it"},
]
maintainers = [
{name = "Peter Bittner", email = "django@bittner.it"},
{name = "Javier Buzzi", email = "buzzi.javier@gmail.com"},
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Environment :: Plugins",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
"Topic :: Software Development :: Testing",
]
keywords = [
"bdd",
"behave",
"django",
"testing",
]
requires-python = ">=3.7"
dependencies = [
"behave[toml]@git+http://github.com/behave/behave.git@v1.2.7.dev4", # behave>=1.2.7.dev3
"django>=3.2",
"beautifulsoup4",
]

[project.urls]
Source = "https://github.com/behave/behave-django"
Documentation = "https://behave-django.readthedocs.io/"

[tool.bandit]
exclude_dirs = [
".git",
Expand All @@ -6,6 +66,15 @@ exclude_dirs = [
"tests",
]

[tool.behave]
junit = true
junit_directory = "tests"
paths = [
"tests/acceptance",
"tests/test_app",
]
show_skipped = false

[tool.black]
color = true

Expand Down Expand Up @@ -37,3 +106,9 @@ addopts = "--color=yes --junitxml=tests/unittests-report.xml --verbose"
testpaths = [
"tests/unit",
]

[tool.setuptools.dynamic]
version = {attr = "behave_django.__version__"}

[tool.setuptools.packages.find]
namespaces = false
3 changes: 0 additions & 3 deletions requirements.txt
bittner marked this conversation as resolved.
Show resolved Hide resolved

This file was deleted.

63 changes: 0 additions & 63 deletions setup.py

This file was deleted.

9 changes: 4 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ envlist =
isort
pylint
# Python/Django combinations that are officially supported
py3{6,7,8,9,10}-django32
py3{7,8,9,10}-django32
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any particular reason for tox now? Figured with github actions, this was moot.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tox is a tool that belongs to the development layer. It abstracts the details of running tests and linting away. Last but not least, it allows to run all the things locally, without the automation component.

I guess it's here to stay. Is there any good reason to get rid of it?

py3{8,9,10,11}-django41
py3{8,9,10,11,12}-django42
py3{10,11,12}-django50
Expand All @@ -19,7 +19,6 @@ envlist =

[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
Expand Down Expand Up @@ -62,7 +61,7 @@ commands = bandit {posargs:-c pyproject.toml -r .}
description = Ensure consistent code style
skip_install = true
deps = black
commands = black {posargs:--check --diff behave_django setup.py tests}
commands = black {posargs:--check --diff behave_django tests}

[testenv:clean]
description = Remove Python bytecode and other debris
Expand All @@ -89,12 +88,12 @@ commands = flake8 {posargs}
description = Ensure imports are ordered consistently
skip_install = true
deps = isort[colors]
commands = isort {posargs:--check-only --diff behave_django setup.py tests}
commands = isort {posargs:--check-only --diff behave_django tests}

[testenv:pylint]
description = Check for errors and code smells
deps = pylint-django
commands = pylint {posargs:--exit-zero behave_django setup}
commands = pylint {posargs:--exit-zero behave_django}

[testenv:package]
description = Build package and check metadata (or upload package)
Expand Down
Loading