Skip to content

Commit 936f97e

Browse files
committed
replace setup.py
1 parent 774b140 commit 936f97e

File tree

12 files changed

+154
-135
lines changed

12 files changed

+154
-135
lines changed

setup.cfg renamed to .bumpversion.cfg

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,3 @@ commit = True
44
tag = False
55

66
[bumpversion:file:mozilla_django_oidc/__init__.py]
7-
8-
[wheel]
9-
universal = 1
10-
11-
[flake8]
12-
max-line-length = 99
13-
exclude = docs,build

.circleci/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ jobs:
4545
steps:
4646
- checkout
4747
- run: mkdir workspace
48+
- run: pip install '.[dev]'
4849
- run: make sdist
49-
- run: mv dist/mozilla-django-oidc-* workspace/mozilla-django-oidc-dev.tar.gz
50+
- run: mv dist/mozilla_django_oidc-* workspace/mozilla-django-oidc-dev.tar.gz
5051
- persist_to_workspace:
5152
root: workspace
5253
paths:

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[flake8]
2+
max-line-length = 99
3+
exclude = docs,build

CONTRIBUTING.rst

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,14 @@ Ready to contribute? Here's how to set up `mozilla-django-oidc` for local develo
6262

6363
$ git clone git@github.com:your_name_here/mozilla-django-oidc.git
6464

65-
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
65+
3. Create a virtual environment and install the package with its
66+
development dependencies. This command will install all the tools
67+
needed for testing and linting::
6668

67-
$ mkvirtualenv mozilla-django-oidc
6869
$ cd mozilla-django-oidc/
69-
$ python setup.py develop
70+
$ python -m venv .venv
71+
$ source .venv/bin/activate # On Windows use `.venv\Scripts\activate`
72+
$ pip install -e .[dev]
7073

7174
4. Create a branch for local development::
7275

@@ -78,7 +81,7 @@ Ready to contribute? Here's how to set up `mozilla-django-oidc` for local develo
7881
tests, including testing other Python versions with tox::
7982

8083
$ flake8 mozilla_django_oidc tests
81-
$ python setup.py test
84+
$ DJANGO_SETTINGS_MODULE=tests.settings python -m django test
8285
$ tox
8386

8487
To get flake8 and tox, just pip install them into your virtualenv.
@@ -106,9 +109,9 @@ Before you submit a pull request, check that it meets these guidelines:
106109
2. If the pull request adds functionality, the docs should be updated. Put
107110
your new functionality into a function with a docstring, and add the
108111
feature to the list in README.rst.
109-
3. The pull request should work for Python 3.6+ and for PyPy. Check
110-
`<https://github.com/mozilla/mozilla-django-oidc/actions>`_
111-
and make sure that the tests pass for all supported Python versions.
112+
3. The pull request should work for Python 3.8+. Check
113+
`<https://github.com/mozilla/mozilla-django-oidc/actions>`_ and make sure
114+
that the tests pass for all supported Python versions.
112115

113116
Tips
114117
----
@@ -120,14 +123,14 @@ We use tox to run tests::
120123

121124
To run a specific environment, use the ``-e`` argument::
122125

123-
$ tox -e py27-django111
126+
$ tox -e py312-django420
124127

125128

126129
You can also run the tests in a virtual environment without tox::
127130

128-
$ DJANGO_SETTINGS_MODULE=tests.settings django-admin test
131+
$ DJANGO_SETTINGS_MODULE=tests.settings python -m django test
129132

130133

131134
You can specify test modules to run rather than the whole suite::
132135

133-
$ DJANGO_SETTINGS_MODULE=tests.settings django-admin test tests.test_views
136+
$ DJANGO_SETTINGS_MODULE=tests.settings python -m django test tests.test_views

MANIFEST.in

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@ include CONTRIBUTING.rst
33
include HISTORY.rst
44
include LICENSE
55
include README.rst
6-
recursive-include mozilla_django_oidc *.html *.png *.gif *js *.css *jpg *jpeg *svg *py
6+
7+
include .flake8
8+
include .bumpversion.cfg
9+
recursive-include docs *
10+
recursive-include integration_tests *

Makefile

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,19 @@ clean-pyc: ## remove Python file artifacts
1515
find . -name '*.pyc' -exec rm -f {} +
1616
find . -name '*.pyo' -exec rm -f {} +
1717
find . -name '*~' -exec rm -f {} +
18+
find . -name '__pycache__' -exec rm -rf {} +
1819

1920
lint: ## check style with flake8
2021
flake8 mozilla_django_oidc tests
2122

2223
test: ## run tests quickly with the default Python
23-
DJANGO_SETTINGS_MODULE=tests.settings django-admin test
24+
DJANGO_SETTINGS_MODULE=tests.settings python -m django test
2425

2526
test-all: ## run tests on every Python version with tox
2627
tox
2728

2829
coverage: ## check code coverage quickly with the default Python
29-
DJANGO_SETTINGS_MODULE=tests.settings coverage run --source mozilla_django_oidc `which django-admin` test
30+
coverage run --source mozilla_django_oidc -m django test --settings=tests.settings
3031
coverage report -m
3132
coverage html
3233
open htmlcov/index.html
@@ -37,10 +38,13 @@ docs: ## generate Sphinx HTML documentation, including API docs
3738
$(MAKE) -C docs clean
3839
$(MAKE) -C docs html
3940

40-
release: clean ## package and upload a release
41-
python setup.py sdist upload
42-
python setup.py bdist_wheel upload
41+
build: clean ## build the sdist and wheel
42+
python -m build . --sdist --wheel
43+
ls -l dist
44+
45+
release: build ##package and upload a release
46+
twine upload dist/*
4347

4448
sdist: clean ## package
45-
python setup.py sdist
49+
python -m build . --sdist
4650
ls -l dist

pyproject.toml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=61.0",
4+
"wheel"
5+
]
6+
build-backend = "setuptools.build_meta"
7+
8+
[project]
9+
name = "mozilla-django-oidc"
10+
dynamic = ["version", "readme"]
11+
description = "A lightweight authentication and access management library for integration with OpenID Connect enabled authentication services."
12+
authors = [
13+
{ name = "Tasos Katsoulas", email = "akatsoulas@mozilla.com" },
14+
{ name = "John Giannelos", email = "jgiannelos@mozilla.com" }
15+
]
16+
license = "MPL-2.0"
17+
keywords = ["mozilla-django-oidc"]
18+
classifiers = [
19+
"Development Status :: 5 - Production/Stable",
20+
"Framework :: Django",
21+
"Framework :: Django :: 3.2",
22+
"Framework :: Django :: 4.2",
23+
"Intended Audience :: Developers",
24+
"Operating System :: MacOS",
25+
"Operating System :: POSIX :: Linux",
26+
"Natural Language :: English",
27+
"Programming Language :: Python :: 3",
28+
"Programming Language :: Python :: 3 :: Only",
29+
"Programming Language :: Python :: 3.8",
30+
"Programming Language :: Python :: 3.9",
31+
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: 3.11",
33+
"Programming Language :: Python :: 3.12",
34+
]
35+
36+
dependencies = [
37+
"Django >= 3.2",
38+
"pyjwt",
39+
"requests",
40+
"cryptography",
41+
]
42+
43+
[project.urls]
44+
Homepage = "https://github.com/mozilla/mozilla-django-oidc"
45+
Documentation = "https://mozilla-django-oidc.readthedocs.io"
46+
Changelog = "https://github.com/mozilla/mozilla-django-oidc/releases"
47+
48+
[project.optional-dependencies]
49+
drf = [
50+
"djangorestframework>=3.14",
51+
]
52+
test = [
53+
"bumpversion",
54+
"ipython",
55+
"ipdb",
56+
"djangorestframework>=3.14",
57+
"pre-commit",
58+
"responses",
59+
"importlib-metadata; python_version < '3.10'",
60+
"coverage",
61+
"tox",
62+
]
63+
lint = [
64+
"flake8",
65+
]
66+
build = [
67+
"build",
68+
]
69+
docs = [
70+
"sphinx",
71+
"sphinx_rtd_theme",
72+
"readthedocs-sphinx-search",
73+
]
74+
dev = [
75+
"mozilla-django-oidc[test,docs,drf,lint,build]",
76+
]
77+
78+
[tool.setuptools]
79+
include-package-data = true
80+
zip-safe = false
81+
82+
[tool.setuptools.dynamic]
83+
version = { attr = "mozilla_django_oidc.__version__" }
84+
readme = { file = ["README.rst"], "content-type" = "text/x-rst" }
85+
86+
[tool.setuptools.packages.find]
87+
include = ["mozilla_django_oidc", "mozilla_django_oidc.*"]
88+
exclude = ["build*", "dist*", "*.egg-info*"]

requirements/requirements_dev.txt

Lines changed: 0 additions & 16 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 73 deletions
This file was deleted.

tests/requirements.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)