Skip to content

Commit

Permalink
Merge pull request #118 from kurtmckee/use-pep-621-metadata
Browse files Browse the repository at this point in the history
Migrate to PEP 621 metadata in `pyproject.toml`
  • Loading branch information
kurtmckee authored Jan 5, 2025
2 parents 2c09b1b + 1bc60d3 commit 8553317
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 47 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ repos:
- id: "check-readthedocs"

- repo: "https://github.com/rhysd/actionlint"
rev: "v1.7.4"
rev: "v1.7.6"
hooks:
- id: "actionlint"

- repo: "https://github.com/kurtmckee/pre-commit-hooks"
rev: "v0.1.1"
rev: "v1.0.0"
hooks:
- id: "verify-consistent-pyproject-toml-python-requirements"
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright 2009-2024 Kurt McKee <[email protected]>
Copyright 2009-2025 Kurt McKee <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 5 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
..
This file is part of listparser.
Copyright 2009-2025 Kurt McKee <[email protected]>
SPDX-License-Identifier: MIT
.. image:: docs/_static/banner.png
:alt: listparser: Parse OPML subscription lists in Python.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Development
-----------

* Migrate to PEP 621 metadata in ``pyproject.toml``.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@

# General information about the project.
project = "listparser"
copyright = "2009-2024 Kurt McKee"
copyright = "2009-2025 Kurt McKee"

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
pyproject = pathlib.Path(__file__).parent.parent / "pyproject.toml"
info = tomllib.loads(pyproject.read_text())
version = release = info["tool"]["poetry"]["version"]
version = release = info["project"]["version"]

# List of directories, relative to source directory, that shouldn't be searched
# for source files.
Expand Down
34 changes: 18 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,37 @@
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"


# poetry
# ------

[tool.poetry]
[project]
name = "listparser"
version = "0.20"
description = "Parse OPML subscription lists"
authors = ["Kurt McKee <[email protected]>"]
authors = [
{ name = "Kurt McKee", email = "[email protected]" },
]
license = "MIT"
readme = "README.rst"
repository = "https://github.com/kurtmckee/listparser/"
documentation = "https://listparser.readthedocs.io/en/latest/"
keywords = ["opml", "foaf", "feed"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Topic :: Text Processing :: Markup :: XML",
]
requires-python = ">=3.9"

[tool.poetry.dependencies]
python = ">=3.9"
# The dependencies here must match the minimums tested in `tox.ini`.
requests = {version = ">=2.32.0,<3", optional = true}
lxml = {version = ">=4.6.2,<6", optional = true}
[project.urls]
Repository = "https://github.com/kurtmckee/listparser/"
Documentation = "https://listparser.readthedocs.io/en/latest/"

[tool.poetry.extras]
http = ["requests"]
lxml = ["lxml"]
[project.optional-dependencies]
# The dependencies here must match the minimums tested in `tox.ini`.
http = [
"requests >=2.32.0, <3",
]
lxml = [
"lxml >=4.6.2, <6",
]


# coverage
Expand Down
6 changes: 3 additions & 3 deletions requirements/docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
alabaster==0.7.16 ; python_version >= "3.9"
babel==2.16.0 ; python_version >= "3.9"
certifi==2024.12.14 ; python_version >= "3.9"
charset-normalizer==3.4.0 ; python_version >= "3.9"
charset-normalizer==3.4.1 ; python_version >= "3.9"
colorama==0.4.6 ; python_version >= "3.9" and sys_platform == "win32"
docutils==0.21.2 ; python_version >= "3.9"
idna==3.10 ; python_version >= "3.9"
Expand All @@ -10,7 +10,7 @@ importlib-metadata==8.5.0 ; python_version < "3.10" and python_version >= "3.9"
jinja2==3.1.5 ; python_version >= "3.9"
markupsafe==3.0.2 ; python_version >= "3.9"
packaging==24.2 ; python_version >= "3.9"
pygments==2.18.0 ; python_version >= "3.9"
pygments==2.19.0 ; python_version >= "3.9"
requests==2.32.3 ; python_version >= "3.9"
snowballstemmer==2.2.0 ; python_version >= "3.9"
sphinx==7.4.7 ; python_version >= "3.9"
Expand All @@ -21,5 +21,5 @@ sphinxcontrib-jsmath==1.0.1 ; python_version >= "3.9"
sphinxcontrib-qthelp==2.0.0 ; python_version >= "3.9"
sphinxcontrib-serializinghtml==2.0.0 ; python_version >= "3.9"
tomli==2.2.1 ; python_version < "3.11" and python_version >= "3.9"
urllib3==2.2.3 ; python_version >= "3.9"
urllib3==2.3.0 ; python_version >= "3.9"
zipp==3.21.0 ; python_version < "3.10" and python_version >= "3.9"
4 changes: 2 additions & 2 deletions requirements/mypy/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
lxml-stubs==0.5.1 ; python_version >= "3.9"
mypy-extensions==1.0.0 ; python_version >= "3.9"
mypy==1.14.0 ; python_version >= "3.9"
mypy==1.14.1 ; python_version >= "3.9"
tomli==2.2.1 ; python_version < "3.11" and python_version >= "3.9"
types-requests==2.32.0.20241016 ; python_version >= "3.9"
types-toml==0.10.8.20240310 ; python_version >= "3.9"
typing-extensions==4.12.2 ; python_version >= "3.9"
urllib3==2.2.3 ; python_version >= "3.9"
urllib3==2.3.0 ; python_version >= "3.9"
2 changes: 1 addition & 1 deletion requirements/test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
colorama==0.4.6 ; python_version >= "3.9" and sys_platform == "win32"
coverage[toml]==7.6.9 ; python_version >= "3.9"
coverage[toml]==7.6.10 ; python_version >= "3.9"
exceptiongroup==1.2.2 ; python_version < "3.11" and python_version >= "3.9"
importlib-metadata==8.5.0 ; python_version < "3.10" and python_version >= "3.9"
iniconfig==2.0.0 ; python_version >= "3.9"
Expand Down
2 changes: 1 addition & 1 deletion src/listparser/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of listparser.
# Copyright 2009-2024 Kurt McKee <[email protected]>
# Copyright 2009-2025 Kurt McKee <[email protected]>
# SPDX-License-Identifier: MIT
#

Expand Down
2 changes: 1 addition & 1 deletion src/listparser/common.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of listparser.
# Copyright 2009-2024 Kurt McKee <[email protected]>
# Copyright 2009-2025 Kurt McKee <[email protected]>
# SPDX-License-Identifier: MIT
#

Expand Down
2 changes: 1 addition & 1 deletion src/listparser/dates.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of listparser.
# Copyright 2009-2024 Kurt McKee <[email protected]>
# Copyright 2009-2025 Kurt McKee <[email protected]>
# SPDX-License-Identifier: MIT
#

Expand Down
2 changes: 1 addition & 1 deletion src/listparser/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of listparser.
# Copyright 2009-2024 Kurt McKee <[email protected]>
# Copyright 2009-2025 Kurt McKee <[email protected]>
# SPDX-License-Identifier: MIT
#

Expand Down
2 changes: 1 addition & 1 deletion src/listparser/foaf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of listparser.
# Copyright 2009-2024 Kurt McKee <[email protected]>
# Copyright 2009-2025 Kurt McKee <[email protected]>
# SPDX-License-Identifier: MIT
#

Expand Down
2 changes: 1 addition & 1 deletion src/listparser/opml.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of listparser.
# Copyright 2009-2024 Kurt McKee <[email protected]>
# Copyright 2009-2025 Kurt McKee <[email protected]>
# SPDX-License-Identifier: MIT
#

Expand Down
2 changes: 1 addition & 1 deletion src/listparser/xml_handler.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of listparser.
# Copyright 2009-2024 Kurt McKee <[email protected]>
# Copyright 2009-2025 Kurt McKee <[email protected]>
# SPDX-License-Identifier: MIT
#

Expand Down
2 changes: 1 addition & 1 deletion tests/test_dates.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of listparser.
# Copyright 2009-2024 Kurt McKee <[email protected]>
# Copyright 2009-2025 Kurt McKee <[email protected]>
# SPDX-License-Identifier: MIT
#

Expand Down
2 changes: 1 addition & 1 deletion tests/test_http.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of listparser.
# Copyright 2009-2024 Kurt McKee <[email protected]>
# Copyright 2009-2025 Kurt McKee <[email protected]>
# SPDX-License-Identifier: MIT
#

Expand Down
2 changes: 1 addition & 1 deletion tests/test_super_dict.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of listparser.
# Copyright 2009-2024 Kurt McKee <[email protected]>
# Copyright 2009-2025 Kurt McKee <[email protected]>
# SPDX-License-Identifier: MIT
#

Expand Down
2 changes: 1 addition & 1 deletion tests/test_xml.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This file is part of listparser.
# Copyright 2009-2024 Kurt McKee <[email protected]>
# Copyright 2009-2025 Kurt McKee <[email protected]>
# SPDX-License-Identifier: MIT
#

Expand Down
12 changes: 3 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ base_python = py3.13
recreate = true
description = Update tool dependency versions
skip_install = true
setenv =
# The actionlint pre-commit hook needs the GOCACHE environment variables.
GOCACHE={env_dir}/.gocache
deps =
poetry
poetry-plugin-export
Expand All @@ -80,19 +77,16 @@ deps =
commands =
# Update test requirements
poetry update --directory="requirements/docs" --lock
poetry export --directory="requirements/docs" --output="requirements/docs/requirements.txt" --without-hashes
poetry export --directory="requirements/docs" --output="requirements.txt" --without-hashes
poetry update --directory="requirements/mypy" --lock
poetry export --directory="requirements/mypy" --output="requirements/mypy/requirements.txt" --without-hashes
poetry export --directory="requirements/mypy" --output="requirements.txt" --without-hashes
poetry update --directory="requirements/test" --lock
poetry export --directory="requirements/test" --output="requirements/test/requirements.txt" --without-hashes
poetry export --directory="requirements/test" --output="requirements.txt" --without-hashes

# Update pre-commit hook versions
pre-commit autoupdate
upadup

# Run pre-commit immediately, but ignore its exit code
- pre-commit run -a


[flake8]
max-line-length = 88
Expand Down

0 comments on commit 8553317

Please sign in to comment.