Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to hatchling #472

Merged
merged 11 commits into from
Jan 29, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ jobs:
- name: Check Newsfragment
nox: check_newsfragment
run-if: ${{ github.head_ref != 'pre-commit-ci-update-config' }}
- name: Check package manifest
nox: check_manifest
run-if: true
- name: Check mypy
nox: typecheck
run-if: true
Expand Down
37 changes: 20 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
*.egg-info/
*.lock
*.o
*.py[co]
*.pyproj
*.so
_trial_temp*/
build/
dropin.cache
doc/
docs/_build/
dist/
venv/
htmlcov/
.coverage
*~
*.lock
apidocs/
.vs/
*.pyproj
.DS_Store
.eggs
.nox/
.coverage
.coverage.*
.vscode
.direnv
.envrc
.idea
.mypy_cache
.nox/
.pytest_cache
.python-version
.vs/
.vscode
Justfile
_trial_temp*/
apidocs/
dist/
doc/
docs/_build/
dropin.cache
htmlcov/
tmp/
venv/
File renamed without changes.
2 changes: 1 addition & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ The following list contains some ways how to run the test suite:
* To run some quality checks before you create the pull request,
we recommend using this call::

$ nox -e pre_commit check_manifest check_newsfragment
$ nox -e pre_commit check_newsfragment

* Or enable `pre-commit` as a git hook::

Expand Down
20 changes: 0 additions & 20 deletions MANIFEST.in

This file was deleted.

11 changes: 2 additions & 9 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ def check_newsfragment(session: nox.Session) -> None:
session.run("python", "-m", "towncrier.check", "--compare-with", "origin/trunk")


@nox.session
def check_manifest(session: nox.Session) -> None:
session.install("check-manifest")
session.run("check-manifest")


@nox.session
def typecheck(session: nox.Session) -> None:
session.install(".", "mypy", "types-setuptools")
Expand All @@ -87,11 +81,10 @@ def docs(session: nox.Session) -> None:

@nox.session
def build(session: nox.Session) -> None:
session.install("build", "check-manifest>=0.44", "twine")
session.install("build", "twine")

session.run("check-manifest", "--verbose")
# If no argument is passed, build builds an sdist and then a wheel from
# that sdist.
session.run("python", "-m", "build")

session.run("twine", "check", "dist/*")
session.run("twine", "check", "--strict", "dist/*")
hynek marked this conversation as resolved.
Show resolved Hide resolved
85 changes: 77 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,80 @@
[build-system]
requires = [
"hatchling ~= 1.12.2",
"wheel ~= 0.38.4",
"incremental == 22.10.0",
]
build-backend = "hatchling.build"


[project]
dynamic = ["version"]
name = "towncrier"
description = "Building newsfiles for your project."
readme = "README.rst"
license = "MIT"
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
requires-python = ">=3.7"
dependencies = [
"click",
"click-default-group",
"incremental",
"jinja2",
"setuptools",
"tomli; python_version<'3.11'",
]

[project.optional-dependencies]
dev = [
"packaging",
"sphinx >= 5",
"furo",
"twisted",
]

[project.scripts]
towncrier = "towncrier._shell:cli"

[project.urls]
Documentation = "https://towncrier.readthedocs.io/"
Chat = "https://web.libera.chat/?channels=%23twisted"
"Mailing list" = "https://mail.python.org/mailman3/lists/twisted.python.org/"
Issues = "https://github.com/twisted/towncrier/issues"
Repository = "https://github.com/twisted/towncrier"
Tests = "https://github.com/twisted/towncrier/actions?query=branch%3Atrunk"
Coverage = "https://codecov.io/gh/twisted/towncrier"
Distribution = "https://pypi.org/project/towncrier"


[tool.hatch.version]
source = "code"
path = "src/towncrier/_version.py"
expression = "_hatchling_version"

[tool.hatch.build]
exclude = [
"admin",
"bin",
"docs",
".readthedocs.yaml",
"src/towncrier/newsfragments",
]


[tool.towncrier]
package = "towncrier"
package_dir = "src"
Expand Down Expand Up @@ -77,14 +154,6 @@ module = 'incremental'
ignore_missing_imports = true


[build-system]
requires = [
"setuptools ~= 44.1.1",
"wheel ~= 0.36.2",
"incremental == 22.10.0",
]
build-backend = "setuptools.build_meta"

[tool.coverage.run]
parallel = true
branch = true
Expand Down
66 changes: 0 additions & 66 deletions setup.py

This file was deleted.

4 changes: 3 additions & 1 deletion src/towncrier/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@


__version__ = Version("towncrier", 22, 12, 1, dev=0)
__all__ = ["__version__"]
_hatchling_version = __version__.short()
hynek marked this conversation as resolved.
Show resolved Hide resolved

__all__ = ["__version__", "_hatchling_version"]
Empty file.