Skip to content

Commit 183f70f

Browse files
Consolidate Python build/configuration into pyproject.toml (#135)
* Consolidate Python build/configuration into pyproject.toml * feat: get the build working without versioneer or setup.py * fix: version * fix: docker build and dev requirements pinning * feat: rearrange and prettify pyproject.toml a bit * docs: setup changelog for a release
1 parent 7270b06 commit 183f70f

File tree

11 files changed

+92
-849
lines changed

11 files changed

+92
-849
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ __pycache__/
103103
# Distribution / packaging
104104
.Python
105105
build/
106+
src/fideslang/_version.py
106107
develop-eggs/
107108
dist/
108109
downloads/

CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@ The types of changes are:
1414
- `Fixed` for any bug fixes.
1515
- `Security` in case of vulnerabilities.
1616

17-
## [Unreleased](https://github.com/ethyca/fideslang/compare/1.4.2...main)
17+
## [Unreleased](https://github.com/ethyca/fideslang/compare/1.4.3...main)
1818

19+
## [1.4.3](https://github.com/ethyca/fideslang/compare/1.4.2...1.4.3)
20+
21+
### Changed
22+
23+
- Consolidate Python build tooling into `pyproject.toml` [#135](https://github.com/ethyca/fideslang/pull/135)
1924

2025
## [1.4.2](https://github.com/ethyca/fideslang/compare/1.4.1...1.4.2)
2126

2227
### Added
28+
2329
- Support Pydantic <1.11 [#122] (https://github.com/ethyca/fideslang/pull/122)
2430

2531
### Changed
@@ -32,9 +38,9 @@ The types of changes are:
3238
- Fix Fideslang key finding function [#131](https://github.com/ethyca/fideslang/pull/131)
3339

3440
### Developer Experience
41+
3542
- Allow Docker to select plaform [#121] https://github.com/ethyca/fideslang/pull/121
3643
- Use build time versioneer [#120] https://github.com/ethyca/fideslang/pull/120
37-
-
3844

3945
## [1.4.1](https://github.com/ethyca/fideslang/compare/1.4.0...1.4.1)
4046

Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ RUN pip install -r dev-requirements.txt
3333
COPY requirements.txt requirements.txt
3434
RUN pip install -r requirements.txt
3535

36-
COPY optional-requirements.txt optional-requirements.txt
37-
RUN pip install -r optional-requirements.txt
38-
3936
###############################
4037
## General Application Setup ##
4138
###############################

data_uses.csv

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

dev-requirements.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
black==22.3
2-
ipython
3-
mypy==0.910
4-
nox
5-
packaging==20.9
1+
black==23.3.0
2+
mypy==1.4.0
3+
nox>=2023
4+
packaging>=22.0
65
pre-commit==2.9.3
76
pylint==2.10.0
87
pytest==7.3.1

optional-requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

pyproject.toml

Lines changed: 78 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,76 @@
1+
###############
2+
## Packaging ##
3+
###############
14
[build-system]
2-
requires = ["setuptools", "wheel", "versioneer[toml]==0.28"] # PEP 508 specifications.
3-
4-
[tool.versioneer]
5-
VCS = "git"
6-
style = "pep440"
7-
versionfile_source = "src/fideslang/_version.py"
8-
versionfile_build = "fideslang/_version.py"
9-
tag_prefix = ""
10-
parentdir_prefix = ""
11-
12-
######
13-
# MyPy
14-
######
15-
# [tool.mypy] Waiting for new version of Mypy
16-
# warn_unused_configs = true
17-
# ignore_missing_imports = true
18-
# pretty = true
19-
20-
#######
21-
# Black
22-
#######
5+
requires = ["setuptools", "wheel", "setuptools_scm"]
6+
7+
[project]
8+
name="fideslang"
9+
description="Fides Taxonomy Language"
10+
dynamic = ["dependencies", "version"]
11+
readme = "README.md"
12+
requires-python=">=3.8, <4"
13+
authors = [
14+
{name = "Ethyca, Inc.", email = "[email protected]"}
15+
]
16+
license= {text = "Apache License 2.0"}
17+
classifiers=[
18+
"License :: OSI Approved :: Apache Software License",
19+
"Programming Language :: Python :: 3 :: Only",
20+
"Programming Language :: Python :: 3.8",
21+
"Programming Language :: Python :: 3.9",
22+
"Programming Language :: Python :: 3.10",
23+
"Programming Language :: Python :: 3.11",
24+
"Topic :: Software Development :: Libraries",
25+
]
26+
27+
[project.urls]
28+
documentation = "https://github.com/ethyca/fideslang"
29+
changelog = "https://github.com/ethyca/fideslang/blob/main/CHANGELOG.md"
30+
31+
[tool.setuptools_scm]
32+
write_to = "src/fideslang/_version.py"
33+
34+
[tool.setuptools.dynamic]
35+
dependencies = {file = "requirements.txt"}
36+
37+
[tool.setuptools.packages.find]
38+
where = ["src"]
39+
40+
############
41+
## Typing ##
42+
############
43+
[tool.mypy]
44+
check_untyped_defs = true
45+
disallow_untyped_defs = true
46+
disallow_any_explicit = true
47+
files = ["src"]
48+
no_implicit_reexport = true
49+
plugins = ["pydantic.mypy"]
50+
pretty = true
51+
show_error_codes = true
52+
warn_redundant_casts = true
53+
warn_unused_configs = true
54+
warn_unused_ignores = true
55+
ignore_missing_imports = true
56+
57+
[[tool.mypy.overrides]]
58+
module= "fideslang._version"
59+
ignore_errors=true
60+
61+
[[tool.mypy.overrides]]
62+
module = ["tests.*"]
63+
disallow_untyped_defs = false
64+
65+
[tool.pydantic-mypy]
66+
init_forbid_extra = true
67+
init_typed = true
68+
warn_required_dynamic_aliases = true
69+
warn_untyped_fields = true
70+
71+
###########
72+
## Black ##
73+
###########
2374
[tool.black]
2475
py39 = true
2576
line-length = 88
@@ -42,9 +93,9 @@ exclude = '''
4293
)/
4394
'''
4495

45-
########
46-
# Pylint
47-
########
96+
############
97+
## Pylint ##
98+
############
4899
[tool.pylint.messages_control]
49100
ignore="migrations"
50101
disable=[
@@ -72,9 +123,9 @@ max-line-length="88"
72123
[tool.pylint.basic]
73124
good-names="_,i,setUp,tearDown,maxDiff,default_app_config"
74125

75-
########
76-
# Pytest
77-
########
126+
############
127+
## Pytest ##
128+
############
78129
[tool.pytest.ini_options]
79130
testpaths="tests"
80131
log_level = "DEBUG"

setup.cfg

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

setup.py

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

src/fideslang/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
from fideslang.default_fixtures import COUNTRY_CODES
88
from fideslang.default_taxonomy import DEFAULT_TAXONOMY
99

10-
from . import _version
10+
from ._version import __version__
1111

12-
__version__ = _version.get_versions()["version"]
1312

1413
# Export the Models
1514
from .models import (

0 commit comments

Comments
 (0)