Skip to content

Commit dd90950

Browse files
authored
Move to pyproject (#107)
* move to pyproject.toml * bumped patch version * added bandit back to dev requirements * removed references to setup.py * update black target python version * update changelog * wait for release pr to bump version
1 parent c6de503 commit dd90950

File tree

9 files changed

+83
-117
lines changed

9 files changed

+83
-117
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[bumpversion]
22
current_version = 0.24.0
33

4-
[bumpversion:file:setup.py]
4+
[bumpversion:file:pyproject.toml]
55

66
[bumpversion:file:docs/source/conf.py]

.github/workflows/publish-release.yml

Lines changed: 12 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -9,74 +9,34 @@ on:
99
types: [created]
1010

1111
jobs:
12-
build-source:
12+
build:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v2
1616
- uses: actions/setup-python@v2
1717
with:
18-
python-version: '3.7'
18+
python-version: '3.9'
1919

2020
- name: install build dependencies
21-
run: pip install wheel
21+
run: python -m pip install --upgrade build
2222

23-
- name: build sdist
24-
run: python setup.py sdist
23+
- name: build
24+
run: python -m build
2525

26-
- name: cache buildfiles
27-
uses: actions/cache@v2
28-
env:
29-
cache-name: cache-dist-files
26+
- uses: actions/upload-artifacts@v2
3027
with:
31-
path: ./dist
32-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./dist/**') }}
33-
restore-keys: |
34-
${{ runner.os }}-build-${{ env.cache-name }}-
35-
${{ runner.os }}-build
36-
${{ runner.os }}-
28+
path: dist
3729

38-
build-docs:
30+
publish-pypi:
3931
runs-on: ubuntu-latest
32+
needs: [build]
4033
steps:
41-
- uses: actions/checkout@v2
42-
- uses: actions/setup-python@v2
43-
with:
44-
python-version: '3.7'
45-
46-
- name: install doc build requirements
47-
run: pip install -r requirements-dev.txt -r requirements.txt
48-
49-
- name: build docs
50-
run: cd docs && DJANGO_SETTINGS_MODULE=test.settings make html
51-
52-
- name: cache buildfiles
53-
uses: actions/cache@v2
54-
env:
55-
cache-name: cache-docs
34+
- uses: actions/download-artifact@v2
5635
with:
57-
path: ./docs/build/html
58-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./docs/build/html/**') }}
59-
restore-keys: |
60-
${{ runner.os }}-build-${{ env.cache-name }}-
61-
${{ runner.os }}-build
62-
${{ runner.os }}-
36+
name: artifact
37+
path: dist
6338

64-
publish-pypi:
65-
runs-on: ubuntu-latest
66-
needs: [build-source]
67-
steps:
6839
- uses: pypa/gh-action-pypi-publish@release/v1
6940
with:
7041
user: __token__
7142
password: ${{ secrets.PYPI_API_TOKEN }}
72-
73-
publish-gh-pages:
74-
runs-on: ubuntu-latest
75-
needs: [build-docs]
76-
steps:
77-
- uses: crazy-max/ghaction-github-pages@v2
78-
with:
79-
target_branch: gh-pages
80-
build_dir: docs/build/html
81-
env:
82-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

AUTHORS

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This is the list of django-declarative-apis significant contributors.
2+
#
3+
# This does not necessarily list everyone who has contributed code,
4+
# especially since many employees of one corporation may be contributing.
5+
# To see the full list of contributors, see the revision history in
6+
# source control.
7+
8+
Salesforce, Inc.
9+
Drew Shafer
10+
Demian Brecht
11+
Bob Grant
12+
Hila Manalai
13+
Rohan Roy
14+
Evan Grim

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
# [unreleased] - XXXX-XX-XX
88
### Added
99
- [PR 106](https://github.com/salesforce/django-declarative-apis/pull/106) Test against Python 3.11 in PR checks
10+
- [PR 107](https://github.com/salesforce/django-declarative-apis/pull/107) Update to use pyproject.toml
1011

1112
# [0.24.0] - 2022-11-03
1213
### Added

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ TEST_CMD = ${PYTHON} manage.py test --parallel
88
TEST_WARNINGS_CMD = ${PYTHON} -Wa manage.py test
99
# see .coveragerc for settings
1010
COVERAGE_CMD = coverage run manage.py test --noinput && coverage xml && coverage report
11-
STATIC_CMD = flake8 ${PACKAGE_DIR} ${TEST_DIR} ${EXAMPLE_DIR} setup.py
11+
STATIC_CMD = flake8 ${PACKAGE_DIR} ${TEST_DIR} ${EXAMPLE_DIR}
1212
VULN_STATIC_CMD = bandit -r -ii -ll -x ${PACKAGE_DIR}/migrations ${PACKAGE_DIR}
13-
FORMAT_CMD = black ${PACKAGE_DIR} ${TEST_DIR} ${EXAMPLE_DIR} setup.py
13+
FORMAT_CMD = black ${PACKAGE_DIR} ${TEST_DIR} ${EXAMPLE_DIR}
1414
FORMATCHECK_CMD = ${FORMAT_CMD} --check
1515

1616

1717
install:
18-
pip install --upgrade pip -r requirements.txt -r requirements-dev.txt
18+
pip install --upgrade pip install .[dev]
1919
.PHONY: install
2020

2121
format:

pyproject.toml

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,57 @@
1+
[build-system]
2+
requires = ["setuptools"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "django-declarative-apis"
7+
version = "0.24.0" # set by bumpversion
8+
description = "Simple, readable, declarative APIs for Django"
9+
dynamic = ["readme"]
10+
dependencies = [
11+
"Django >=3.2, <4",
12+
"celery>=4.0.2,!=4.1.0",
13+
"cryptography>=2.0,<=3.4.8",
14+
"decorator==4.0.11",
15+
"django-dirtyfields>=1.2.1",
16+
"oauthlib[signedtoken,rsa]>=2.0.6,<3.1.0",
17+
"pydantic>=1.8"
18+
]
19+
keywords = [
20+
"django",
21+
"rest",
22+
"declarative",
23+
"api"
24+
]
25+
classifiers = [
26+
"Development Status :: 3 - Alpha",
27+
"Environment :: Web Environment",
28+
"Framework :: Django",
29+
"Intended Audience :: Developers",
30+
"License :: OSI Approved :: MIT License",
31+
"Operating System :: OS Independent",
32+
"Programming Language :: Python",
33+
"Topic :: Internet :: WWW/HTTP",
34+
]
35+
36+
[project.optional-dependencies]
37+
dev = [
38+
"bandit>=1.7.4",
39+
"black==22.3.0",
40+
"bumpversion~=0.5",
41+
"coverage[toml]==6.3.2",
42+
"flake8==4.0.1",
43+
"ipython~=7.0",
44+
"oauth2==1.9.0.post1",
45+
"pyyaml~=6.0",
46+
"sphinx_rtd_theme==0.5.2",
47+
"tblib~=1.6.0",
48+
]
49+
[tool.setuptools.dynamic]
50+
readme = {file = ["README.md"]}
51+
152
[tool.black]
253
line-length = 88
3-
target_version = ['py37']
54+
target_version = ['py39']
455
exclude = '''
556
^/(
657
(

requirements-dev.txt

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

requirements.txt

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

setup.py

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

0 commit comments

Comments
 (0)