Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
44 changes: 24 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
# - make check_release
# - make release

.PHONY: clean sterile coverage docs help \
quality requirements test test-all upgrade validate

.DEFAULT_GOAL := help

# For opening files in a browser. Use like: $(BROWSER)relative/path/to/file.html
BROWSER := python -m webbrowser file://$(CURDIR)/

# A command to get the current version. A little slow, but only run when needed.
VERSION := $$(python -c "import build.util as bu; print(bu.project_wheel_metadata('.')['Version'])")

.PHONY: help clean sterile

help: ## display this help message
@echo "Please use \`make <target>' where <target> is one of"
@awk -F ':.*?## ' '/^[a-zA-Z]/ && NF==2 {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort
Expand All @@ -36,6 +38,8 @@ clean: ## remove generated byte code, coverage reports, and build artifacts
sterile: clean ## remove absolutely all built artifacts
rm -fr .tox

.PHONY: coverage docs upgrade diff_upgrade

coverage: clean ## generate and view HTML coverage report
tox -e py39,py313,coverage
$(BROWSER)htmlcov/index.html
Expand All @@ -56,11 +60,6 @@ upgrade: ## update the requirements/*.txt files with the latest packages satisfy
$(PIP_COMPILE) -o requirements/quality.txt requirements/quality.in
$(PIP_COMPILE) -o requirements/tox.txt requirements/tox.in
$(PIP_COMPILE) -o requirements/dev.txt requirements/dev.in
# Splice requirements/base.in into setup.cfg
sed -n -e '1,/begin_install_requires/p' < setup.cfg > setup.tmp
sed -n -e '/^[a-zA-Z]/s/^/ /p' < requirements/base.in >> setup.tmp
sed -n -e '/end_install_requires/,$$p' < setup.cfg >> setup.tmp
mv setup.tmp setup.cfg

diff_upgrade: ## summarize the last `make upgrade`
@# The sort flags sort by the package name first, then by the -/+, and
Expand All @@ -71,8 +70,11 @@ diff_upgrade: ## summarize the last `make upgrade`
@# +build==0.10.0
@git diff -U0 | grep -v '^@' | grep == | sort -k1.2,1.99 -k1.1,1.1r -u -V


.PHONY: botedits quality requirements test test-all validate

botedits: ## make source edits by tools
python -m black --line-length=80 src/scriv tests docs setup.py
python -m black --line-length=80 src/scriv tests docs
python -m cogapp -crP docs/*.rst

quality: ## check coding style with pycodestyle and pylint
Expand All @@ -81,6 +83,7 @@ quality: ## check coding style with pycodestyle and pylint
requirements: ## install development environment requirements
pip install -qr requirements/pip-tools.txt
pip-sync requirements/dev.txt
pip install -e .

test: ## run tests in the current virtualenv
tox -e py39
Expand All @@ -90,30 +93,31 @@ test-all: ## run tests on every supported Python combination

validate: clean botedits quality test ## run tests and quality checks

.PHONY: dist pypi testpypi tag gh_release

dist: ## Build the distributions
.PHONY: dist pypi testpypi tag gh_release comment_text

dist: ## build the distributions
python -m build --sdist --wheel

pypi: ## Upload the built distributions to PyPI.
pypi: ## upload the built distributions to PyPI.
python -m twine upload --verbose dist/*

testpypi: ## Upload the distrubutions to PyPI's testing server.
testpypi: ## upload the distrubutions to PyPI's testing server.
python -m twine upload --verbose --repository testpypi dist/*

tag: ## Make a git tag with the version number
git tag -s -m "Version $$(python setup.py --version)" $$(python setup.py --version)
tag: ## make a git tag with the version number
git tag -s -m "Version $(VERSION)" $(VERSION)
git push --all

gh_release: ## Make a GitHub release
gh_release: ## make a GitHub release
python -m scriv github-release --all --fail-if-warn --check-links

comment_text:
@echo "Use this to comment on issues and pull requests:"
@export V=$$(python setup.py --version); \
echo "This is now released as part of [scriv $$V](https://pypi.org/project/scriv/$$V)."
@echo "This is now released as part of [scriv $(VERSION)](https://pypi.org/project/scriv/$(VERSION))."


.PHONY: release check_release _check_credentials _check_manifest _check_version _check_scriv
.PHONY: release check_release _check_credentials _check_manifest _check_tree _check_version _check_scriv _check_links

release: _check_credentials clean check_release dist pypi tag gh_release comment_text ## do all the steps for a release

Expand All @@ -136,7 +140,7 @@ _check_tree:
fi

_check_version:
@if [[ $$(git tags | grep -q -w $$(python setup.py --version) && echo "x") == "x" ]]; then \
@if [[ $$(git tags | grep -q -w $(VERSION) && echo "x") == "x" ]]; then \
echo 'A git tag for this version exists! Did you forget to bump the version in src/scriv/__init__.py?'; \
exit 1; \
fi
Expand Down
89 changes: 89 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,92 @@
# scriv's pyproject.toml

[project]
name = "scriv"
description = "Scriv changlog management tool"
authors = [
{name = "Ned Batchelder", email = "ned@nedbatchelder.com"},
]
license = "Apache-2.0"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]

requires-python = ">= 3.9"

dynamic = ["readme", "version", "dependencies"]

[project.urls]
"Mastodon" = "https://hachyderm.io/@nedbat"
"Funding" = "https://github.com/sponsors/nedbat"
"Issues" = "https://github.com/nedbat/scriv/issues"
"Source" = "https://github.com/nedbat/scriv"
"Home" = "https://github.com/nedbat/scriv"
"Documentation" = "https://scriv.readthedocs.io"

[project.scripts]
scriv = "scriv.cli:cli"

[project.optional-dependencies]
toml = [
'tomli; python_version < "3.11"'
]
yaml = [
"pyyaml"
]

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

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

[tool.setuptools.package-data]
scriv = [
"templates/*.*",
]

[tool.setuptools.dynamic]
version.attr = "scriv.__version__"
readme.file = ["README.rst", "CHANGELOG.rst"]
dependencies.file = ["requirements/core.txt"]

[tool.scriv]
ghrel_template = "file: ghrel_template.md.j2"
rst_header_chars = "-."
version = "literal: src/scriv/__init__.py: __version__"

[tool.isort]
indent = " "
line_length = 80
multi_line_output = 3
include_trailing_comma = true

[tool.mypy]
python_version = "3.9"
show_column_numbers = true
show_error_codes = true
ignore_missing_imports = true
check_untyped_defs = true
warn_return_any = true

[tool.doc8]
max-line-length = 80

[tool.pydocstyle]
# D105 = Missing docstring in magic method
# D200 = One-line docstring should fit on one line with quotes
# D203 = 1 blank line required before class docstring
# D212 = Multi-line docstring summary should start at the first line
# D406 = Section name should end with a newline (numpy style)
# D407 = Missing dashed underline after section (numpy style)
# D413 = Missing blank line after last section (numpy style)
ignore = ["D105", "D200", "D203", "D212", "D406", "D407", "D413"]
8 changes: 1 addition & 7 deletions requirements/base.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
# Core requirements for using this application

-c constraints.txt

attrs
click
click-log
jinja2>=2.7
markdown-it-py
requests
-r core.txt
12 changes: 6 additions & 6 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,28 @@
# make upgrade
#
attrs==25.3.0
# via -r requirements/base.in
# via -r requirements/core.txt
certifi==2025.1.31
# via requests
charset-normalizer==3.4.1
# via requests
click==8.1.8
# via
# -r requirements/base.in
# -r requirements/core.txt
# click-log
click-log==0.4.0
# via -r requirements/base.in
# via -r requirements/core.txt
idna==3.10
# via requests
jinja2==3.1.6
# via -r requirements/base.in
# via -r requirements/core.txt
markdown-it-py==3.0.0
# via -r requirements/base.in
# via -r requirements/core.txt
markupsafe==3.0.2
# via jinja2
mdurl==0.1.2
# via markdown-it-py
requests==2.32.3
# via -r requirements/base.in
# via -r requirements/core.txt
urllib3==2.3.0
# via requests
8 changes: 8 additions & 0 deletions requirements/core.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Core requirements for using this application

attrs
click
click-log
jinja2>=2.7
markdown-it-py
requests
124 changes: 0 additions & 124 deletions setup.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions setup.py

This file was deleted.

Loading