Skip to content

Commit

Permalink
Consolidate Python build/configuration into pyproject.toml (#135)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
ThomasLaPiana authored Jun 27, 2023
1 parent 7270b06 commit 183f70f
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 849 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ __pycache__/
# Distribution / packaging
.Python
build/
src/fideslang/_version.py
develop-eggs/
dist/
downloads/
Expand Down
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@ The types of changes are:
- `Fixed` for any bug fixes.
- `Security` in case of vulnerabilities.

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

## [1.4.3](https://github.com/ethyca/fideslang/compare/1.4.2...1.4.3)

### Changed

- Consolidate Python build tooling into `pyproject.toml` [#135](https://github.com/ethyca/fideslang/pull/135)

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

### Added

- Support Pydantic <1.11 [#122] (https://github.com/ethyca/fideslang/pull/122)

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

### Developer Experience

- Allow Docker to select plaform [#121] https://github.com/ethyca/fideslang/pull/121
- Use build time versioneer [#120] https://github.com/ethyca/fideslang/pull/120
-

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

Expand Down
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ RUN pip install -r dev-requirements.txt
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt

COPY optional-requirements.txt optional-requirements.txt
RUN pip install -r optional-requirements.txt

###############################
## General Application Setup ##
###############################
Expand Down
47 changes: 0 additions & 47 deletions data_uses.csv

This file was deleted.

9 changes: 4 additions & 5 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
black==22.3
ipython
mypy==0.910
nox
packaging==20.9
black==23.3.0
mypy==1.4.0
nox>=2023
packaging>=22.0
pre-commit==2.9.3
pylint==2.10.0
pytest==7.3.1
Expand Down
1 change: 0 additions & 1 deletion optional-requirements.txt

This file was deleted.

105 changes: 78 additions & 27 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,76 @@
###############
## Packaging ##
###############
[build-system]
requires = ["setuptools", "wheel", "versioneer[toml]==0.28"] # PEP 508 specifications.

[tool.versioneer]
VCS = "git"
style = "pep440"
versionfile_source = "src/fideslang/_version.py"
versionfile_build = "fideslang/_version.py"
tag_prefix = ""
parentdir_prefix = ""

######
# MyPy
######
# [tool.mypy] Waiting for new version of Mypy
# warn_unused_configs = true
# ignore_missing_imports = true
# pretty = true

#######
# Black
#######
requires = ["setuptools", "wheel", "setuptools_scm"]

[project]
name="fideslang"
description="Fides Taxonomy Language"
dynamic = ["dependencies", "version"]
readme = "README.md"
requires-python=">=3.8, <4"
authors = [
{name = "Ethyca, Inc.", email = "fidesteam@ethyca.com"}
]
license= {text = "Apache License 2.0"}
classifiers=[
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries",
]

[project.urls]
documentation = "https://github.com/ethyca/fideslang"
changelog = "https://github.com/ethyca/fideslang/blob/main/CHANGELOG.md"

[tool.setuptools_scm]
write_to = "src/fideslang/_version.py"

[tool.setuptools.dynamic]
dependencies = {file = "requirements.txt"}

[tool.setuptools.packages.find]
where = ["src"]

############
## Typing ##
############
[tool.mypy]
check_untyped_defs = true
disallow_untyped_defs = true
disallow_any_explicit = true
files = ["src"]
no_implicit_reexport = true
plugins = ["pydantic.mypy"]
pretty = true
show_error_codes = true
warn_redundant_casts = true
warn_unused_configs = true
warn_unused_ignores = true
ignore_missing_imports = true

[[tool.mypy.overrides]]
module= "fideslang._version"
ignore_errors=true

[[tool.mypy.overrides]]
module = ["tests.*"]
disallow_untyped_defs = false

[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
warn_untyped_fields = true

###########
## Black ##
###########
[tool.black]
py39 = true
line-length = 88
Expand All @@ -42,9 +93,9 @@ exclude = '''
)/
'''

########
# Pylint
########
############
## Pylint ##
############
[tool.pylint.messages_control]
ignore="migrations"
disable=[
Expand Down Expand Up @@ -72,9 +123,9 @@ max-line-length="88"
[tool.pylint.basic]
good-names="_,i,setUp,tearDown,maxDiff,default_app_config"

########
# Pytest
########
############
## Pytest ##
############
[tool.pytest.ini_options]
testpaths="tests"
log_level = "DEBUG"
Expand Down
23 changes: 0 additions & 23 deletions setup.cfg

This file was deleted.

44 changes: 0 additions & 44 deletions setup.py

This file was deleted.

3 changes: 1 addition & 2 deletions src/fideslang/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
from fideslang.default_fixtures import COUNTRY_CODES
from fideslang.default_taxonomy import DEFAULT_TAXONOMY

from . import _version
from ._version import __version__

__version__ = _version.get_versions()["version"]

# Export the Models
from .models import (
Expand Down
Loading

0 comments on commit 183f70f

Please sign in to comment.