Skip to content

Commit

Permalink
chore: Modernize packaging (#93)
Browse files Browse the repository at this point in the history
- Use VCS versioning.
- Fully move to pyproject.toml.
  • Loading branch information
antonagestam authored Dec 17, 2023
1 parent f678959 commit 72735f0
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 66 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,6 @@ dmypy.json

# Pyre type checker
.pyre/

# Dynamic version file
src/immoney/_version.py
18 changes: 11 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,17 @@ repos:
- --parser=markdown
- --print-width=88
- --prose-wrap=always
- repo: https://github.com/mgedmin/check-manifest
rev: "0.49"
hooks:
- id: check-manifest
args: ["--no-build-isolation"]
additional_dependencies:
- wheel==0.42.0

# TODO: This does not work with VCS versioning.
# - repo: https://github.com/mgedmin/check-manifest
# rev: "0.49"
# hooks:
# - id: check-manifest
# args: ["--no-build-isolation"]
# additional_dependencies:
# - setuptools==69.0.2
# - setuptools-scm==8.0.4
# - wheel==0.42.0

exclude: |
(?x)(
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ include README.md
include LICENSE
exclude generate-currencies.py
exclude generate-requirements.txt
exclude .gitignore
exclude setup.cfg
71 changes: 70 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,76 @@
[build-system]
requires = ["setuptools>=69.0.0", "wheel"]
requires = [
"setuptools==69.0.2",
"setuptools-scm==8.0.4",
"wheel==0.42.0",
]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]
version_file = "src/immoney/_version.py"

[tool.setuptools]
include-package-data = true

[tool.setuptools.dynamic]
readme = {file = "README.md", content-type = "text/markdown; charset=UTF-8"}

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


[project]
name = "immoney"
authors = [
{ name="Anton Agestam", email="git@antonagestam.se" },
]
description = "Immutable money types for Python"
license = {text = "BSD-3-Clause"}
requires-python = ">=3.10"
classifiers = [
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Development Status :: 4 - Beta",
"Typing :: Typed",
]
keywords = [
"money",
"finance",
"fintech",
"type-driven",
"immutable",
]
dynamic = ["version", "readme"]
dependencies = [
"typing-extensions>=4.6.3",
"abcattrs>=0.3.2",
]

[project.optional-dependencies]
pydantic = [
"pydantic>=2.0.3",
# 2.10 deprecates some functions under pydantic.core_schema.*, forcing dropping
# support for prior versions.
"pydantic-core>=2.10",
]
babel = ["babel>=2.12.1"]
test = [
"pytest",
"coverage",
"hypothesis",
]

[project.urls]
"Source Repository" = "https://github.com/antonagestam/immoney/"
"Bug Tracker" = "https://github.com/antonagestam/immoney/issues"


[tool.black]
target-version = ["py310"]
Expand Down
54 changes: 0 additions & 54 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,57 +1,3 @@
[metadata]
name = immoney
version = attr: immoney.__version__
description = Immutable money types for Python
long_description = file: README.md
long_description_content_type = text/markdown; charset=UTF-8
license = BSD 3-Clause License
license_files = LICENSE
classifiers =
Intended Audience :: Developers
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
Development Status :: 4 - Beta
Typing :: Typed
author = Anton Agestam
author_email = git@antonagestam.se
url = https://github.com/antonagestam/immoney/

[options]
include_package_data = True
package_dir =
=src
packages = find:
python_requires = >=3.10
install_requires =
typing-extensions>=4.6.3
abcattrs>=0.3.2

[options.packages.find]
where = src

[options.package_data]
immoney = py.typed

[options.extras_require]
pydantic =
pydantic>=2.0.3
# 2.10 deprecates some functions under pydantic.core_schema.*, forcing dropping
# support for prior versions.
pydantic-core>=2.10

babel =
babel>=2.12.1

test =
pytest
coverage
hypothesis

[mypy]
python_version = 3.10
show_error_codes = True
Expand Down
3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

1 change: 0 additions & 1 deletion src/immoney/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,3 @@
"Overdraft",
"ParsableMoneyValue",
)
__version__ = "0.8.0"

0 comments on commit 72735f0

Please sign in to comment.