Skip to content

Commit cab13c6

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

File tree

12 files changed

+163
-135
lines changed

12 files changed

+163
-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: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ common_steps: &common_steps
55
- checkout
66
- attach_workspace:
77
at: /tmp/workspace
8+
- run:
9+
name: Install geckodriver
10+
command: |
11+
apt-get update && apt-get install -y wget tar
12+
GECKODRIVER_VERSION="v0.34.0"
13+
wget "https://github.com/mozilla/geckodriver/releases/download/${GECKODRIVER_VERSION}/geckodriver-${GECKODRIVER_VERSION}-linux64.tar.gz"
14+
tar -xvzf "geckodriver-${GECKODRIVER_VERSION}-linux64.tar.gz"
15+
mv geckodriver /usr/local/bin/
816
- run:
917
name: Setup testrp /etc/hosts
1018
command: echo 127.0.0.1 testrp | tee -a /etc/hosts
@@ -45,8 +53,9 @@ jobs:
4553
steps:
4654
- checkout
4755
- run: mkdir workspace
56+
- run: pip install '.[dev]'
4857
- run: make sdist
49-
- run: mv dist/mozilla-django-oidc-* workspace/mozilla-django-oidc-dev.tar.gz
58+
- run: mv dist/mozilla_django_oidc-* workspace/mozilla-django-oidc-dev.tar.gz
5059
- persist_to_workspace:
5160
root: workspace
5261
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: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=61.0.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 = { text = "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+
"License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)",
24+
"Intended Audience :: Developers",
25+
"Operating System :: MacOS",
26+
"Operating System :: POSIX :: Linux",
27+
"Natural Language :: English",
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: 3 :: Only",
30+
"Programming Language :: Python :: 3.8",
31+
"Programming Language :: Python :: 3.9",
32+
"Programming Language :: Python :: 3.10",
33+
"Programming Language :: Python :: 3.11",
34+
"Programming Language :: Python :: 3.12",
35+
]
36+
37+
dependencies = [
38+
"Django >= 3.2",
39+
"pyjwt",
40+
"requests",
41+
"cryptography",
42+
]
43+
44+
[project.urls]
45+
Homepage = "https://github.com/mozilla/mozilla-django-oidc"
46+
Documentation = "https://mozilla-django-oidc.readthedocs.io"
47+
Changelog = "https://github.com/mozilla/mozilla-django-oidc/releases"
48+
49+
[project.optional-dependencies]
50+
drf = [
51+
"djangorestframework>=3.14",
52+
]
53+
test = [
54+
"bumpversion",
55+
"ipython",
56+
"ipdb",
57+
"djangorestframework>=3.14",
58+
"pre-commit",
59+
"responses",
60+
"importlib-metadata; python_version < '3.10'",
61+
"coverage",
62+
"tox",
63+
]
64+
lint = [
65+
"flake8",
66+
]
67+
build = [
68+
"build",
69+
]
70+
docs = [
71+
"sphinx",
72+
"sphinx_rtd_theme",
73+
"readthedocs-sphinx-search",
74+
]
75+
dev = [
76+
"mozilla-django-oidc[test,docs,drf,lint,build]",
77+
]
78+
79+
[tool.setuptools]
80+
include-package-data = true
81+
zip-safe = false
82+
83+
[tool.setuptools.dynamic]
84+
version = { attr = "mozilla_django_oidc.__version__" }
85+
readme = { file = ["README.rst"], "content-type" = "text/x-rst" }
86+
87+
[tool.setuptools.packages.find]
88+
include = ["mozilla_django_oidc", "mozilla_django_oidc.*"]
89+
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)