Skip to content

Commit

Permalink
Switch from setup.py to pyproject.toml
Browse files Browse the repository at this point in the history
This'll make configuring a few tools a bit easier. The previous approach
is kinda of deprecated anyway.
  • Loading branch information
WhyNotHugo committed Oct 5, 2023
1 parent 8ebdfe8 commit 99d654d
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.py
cache-dependency-path: pyproject.toml

- name: Install dependencies
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ The following actions are required to push a new version:

bumpversion [major|minor|patch]
git push && git push --tags
python setup.py sdist bdist_wheel
python -m build --wheel --no-isolation
twine upload dist/*


Expand Down
74 changes: 74 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[build-system]
requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2"]

[project]
name = "django-user-sessions"
authors = [
{name = "Bouke Haarsma", email = "[email protected]"},
# {name = "Hugo Osvaldo Barrera", email = "[email protected]"},
]
description = "Django sessions with a foreign key to the user"
readme = "README.rst"
# TOOD: drop 3.7
requires-python = ">=3.7"
keywords = ["django", "sessions"]
license = {text = "MIT"}
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.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",
"Topic :: Security",
]
dependencies = [
"Django>=3.2",
]
dynamic = ["version"]

[project.urls]
homepage = "https://github.com/jazzband/django-user-sessions"
download = "https://pypi.org/project/django-user-sessions/"
documentation = "https://django-user-sessions.readthedocs.io/en/stable/"
changelog = "https://django-user-sessions.readthedocs.io/en/stable/release-notes.html"
issues = "https://github.com/jazzband/django-user-sessions/issues"

[tool.setuptools_scm]
version_scheme = "post-release"

[project.optional-dependencies]
dev = [
# Example app
"django-debug-toolbar",
# Testing
"coverage",
"flake8",
"tox",
"tox-pyenv",
"detox",
"isort",
# Transifex
"transifex-client",
# Documentation
"Sphinx",
"sphinx_rtd_theme",
# Build
"wheel", # TODO: not required?
"bumpversion", # TODO: unused?
"twine",
]

[tool.setuptools]
packages = ["user_sessions"]

# TODO: confirm that package data is shipped properly
31 changes: 0 additions & 31 deletions requirements_dev.txt

This file was deleted.

36 changes: 0 additions & 36 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,36 +0,0 @@
from setuptools import find_packages, setup

setup(
name='django-user-sessions',
use_scm_version={"version_scheme": "post-release"},
setup_requires=["setuptools_scm"],
description='Django sessions with a foreign key to the user',
long_description=open('README.rst').read(),
author='Bouke Haarsma',
author_email='[email protected]',
url='https://github.com/jazzband/django-user-sessions',
download_url='https://pypi.org/project/django-user-sessions/',
license='MIT',
packages=find_packages(exclude=('example', 'tests',)),
install_requires=['Django>=3.2'],
include_package_data=True,
python_requires='>=3.7',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.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',
'Topic :: Security',
],
)

0 comments on commit 99d654d

Please sign in to comment.