Skip to content

Commit de5479d

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

File tree

19 files changed

+180
-163
lines changed

19 files changed

+180
-163
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: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ common_steps: &common_steps
1313
command: echo 127.0.0.1 testprovider | tee -a /etc/hosts
1414
- run:
1515
name: Install latest lib build
16-
command: . /testrp_env/bin/activate && pip install /tmp/workspace/mozilla-django-oidc-dev.tar.gz
16+
command: . /testrp_env/bin/activate && pip install /tmp/workspace/mozilla-django-oidc-dev.tar.gz[test]
1717
- run:
1818
name: Override django version
1919
command: . /testrp_env/bin/activate && pip install $DJANGO_VERSION
@@ -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

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ jobs:
1515
name: Python ${{ matrix.python_version }}
1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v4
1919
- name: Setup python
20-
uses: actions/setup-python@v2
20+
uses: actions/setup-python@v5
2121
with:
2222
python-version: ${{ matrix.python_version }}
2323
- name: Install dependencies

.github/workflows/codecov.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ jobs:
77
name: Codecov
88
steps:
99
- name: Checkout repository
10-
uses: actions/checkout@v2
10+
uses: actions/checkout@v4
1111
- name: Setup python
12-
uses: actions/setup-python@v2
12+
uses: actions/setup-python@v5
1313
with:
1414
python-version: '3.12'
1515
- name: Install dependencies
1616
run: pip install codecov tox tox-gh-actions
1717
- name: Run tox
1818
run: tox
19-
- uses: codecov/codecov-action@v1
19+
- uses: codecov/codecov-action@v5
2020
with:
2121
verbose: true

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010
name: Mozilla Django OIDC Release
1111
steps:
1212
- name: Checkout repository
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v4
1414
- name: Setup python
15-
uses: actions/setup-python@v2
15+
uses: actions/setup-python@v5
1616
with:
1717
python-version: "3.12"
1818
- name: Install dependencies
@@ -28,7 +28,7 @@ jobs:
2828
--outdir dist/
2929
.
3030
- name: Publish a Python distribution to PyPI
31-
uses: pypa/gh-action-pypi-publish@v1.4.2
31+
uses: pypa/gh-action-pypi-publish@v1
3232
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
3333
with:
3434
user: __token__

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ Contributors
2929
* Antti Palola (`@anttipalola <https://github.com/anttipalola>`_)
3030
* Bono de Visser (`@kerrermanisNL <https://github.com/kerrermanisNL>`_)
3131
* Chris Brantley (`@chrisbrantley <https://github.com/chrisbrantley>`_)
32+
* Ryan Johnson (`@escattone <https://github.com/escattone>`_)

CONTRIBUTING.rst

Lines changed: 14 additions & 13 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

@@ -77,12 +80,10 @@ Ready to contribute? Here's how to set up `mozilla-django-oidc` for local develo
7780
5. When you're done making changes, check that your changes pass flake8 and the
7881
tests, including testing other Python versions with tox::
7982

80-
$ flake8 mozilla_django_oidc tests
81-
$ python setup.py test
83+
$ make lint
84+
$ make test
8285
$ tox
8386

84-
To get flake8 and tox, just pip install them into your virtualenv.
85-
8687
6. Make sure you update ``HISTORY.rst`` with your changes in the following categories
8788

8889
* Backwards-incompatible changes
@@ -106,9 +107,9 @@ Before you submit a pull request, check that it meets these guidelines:
106107
2. If the pull request adds functionality, the docs should be updated. Put
107108
your new functionality into a function with a docstring, and add the
108109
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.
110+
3. The pull request should work for Python 3.8+. Check
111+
`<https://github.com/mozilla/mozilla-django-oidc/actions>`_ and make sure
112+
that the tests pass for all supported Python versions.
112113

113114
Tips
114115
----
@@ -120,14 +121,14 @@ We use tox to run tests::
120121

121122
To run a specific environment, use the ``-e`` argument::
122123

123-
$ tox -e py27-django111
124+
$ tox -e py312-django420
124125

125126

126127
You can also run the tests in a virtual environment without tox::
127128

128-
$ DJANGO_SETTINGS_MODULE=tests.settings django-admin test
129+
$ make test
129130

130131

131132
You can specify test modules to run rather than the whole suite::
132133

133-
$ DJANGO_SETTINGS_MODULE=tests.settings django-admin test tests.test_views
134+
$ 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

0 commit comments

Comments
 (0)