Skip to content

Commit e0dee8d

Browse files
looks testable to me (#3)
1 parent b905166 commit e0dee8d

File tree

12 files changed

+373
-0
lines changed

12 files changed

+373
-0
lines changed

.gitignore

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
*.log
2+
minimal.py
3+
*_old.*
4+
config.ini
5+
*.csv
6+
*.msg
7+
!requirements.txt
8+
*.xlsx
9+
*.rtf
10+
Out-Null
11+
12+
# Vim files
13+
*~
14+
*.swp
15+
*.swo
16+
17+
# Byte-compiled / optimized / DLL files
18+
__pycache__/
19+
*.py[cod]
20+
*$py.class
21+
22+
# C extensions
23+
*.so
24+
25+
# Distribution / packaging
26+
.Python
27+
build/
28+
develop-eggs/
29+
dist/
30+
downloads/
31+
eggs/
32+
.eggs/
33+
lib/
34+
lib64/
35+
parts/
36+
sdist/
37+
var/
38+
wheels/
39+
pip-wheel-metadata/
40+
share/python-wheels/
41+
*.egg-info/
42+
.installed.cfg
43+
*.egg
44+
MANIFEST
45+
46+
# PyInstaller
47+
# Usually these files are written by a python script from a template
48+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
49+
*.manifest
50+
*.spec
51+
52+
# Installer logs
53+
pip-log.txt
54+
pip-delete-this-directory.txt
55+
56+
# Unit test / coverage reports
57+
htmlcov/
58+
.tox/
59+
.nox/
60+
.coverage
61+
.coverage.*
62+
.cache
63+
nosetests.xml
64+
coverage.xml
65+
*.cover
66+
*.py,cover
67+
.hypothesis/
68+
.pytest_cache/
69+
70+
# Translations
71+
*.mo
72+
*.pot
73+
74+
# Django stuff:
75+
*.log
76+
local_settings.py
77+
db.sqlite3
78+
db.sqlite3-journal
79+
80+
# Flask stuff:
81+
instance/
82+
.webassets-cache
83+
84+
# Scrapy stuff:
85+
.scrapy
86+
87+
# Sphinx documentation
88+
docs/_build/
89+
90+
# PyBuilder
91+
target/
92+
93+
# Jupyter Notebook
94+
.ipynb_checkpoints
95+
96+
# IPython
97+
profile_default/
98+
ipython_config.py
99+
100+
# pyenv
101+
.python-version
102+
103+
# pipenv
104+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
105+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
106+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
107+
# install all needed dependencies.
108+
#Pipfile.lock
109+
110+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
111+
__pypackages__/
112+
113+
# Celery stuff
114+
celerybeat-schedule
115+
celerybeat.pid
116+
117+
# SageMath parsed files
118+
*.sage.py
119+
120+
# Environments
121+
.env
122+
.venv
123+
env/
124+
venv/
125+
ENV/
126+
env.bak/
127+
venv.bak/
128+
129+
# Spyder project settings
130+
.spyderproject
131+
.spyproject
132+
133+
# Rope project settings
134+
.ropeproject
135+
136+
# mkdocs documentation
137+
/site
138+
139+
# mypy
140+
.mypy_cache/
141+
.dmypy.json
142+
dmypy.json
143+
144+
# Pyre type checker
145+
.pyre/

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
<!-- towncrier release notes start -->
4+
5+

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# hatch-semver
2+
3+
A plugin for [hatch][hatch] to support [semantic versioning][semver].
4+
5+
6+
7+
[hatch]: hatch.pypa.io/
8+
[semver]: https://semver.org/

changelog.d/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!.gitignore

changelog.d/1.detail.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Prepared project
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{% if sections[""] %}
2+
{% for category, val in definitions.items() if category in sections[""] %}
3+
4+
### {{ definitions[category]['name'] }}
5+
6+
{% for text, values in sections[""][category].items() %}
7+
- {{ text }} {{ values|join(', ') }}
8+
{% endfor %}
9+
10+
{% endfor %}
11+
{% else %}
12+
No significant changes.
13+
14+
15+
{% endif %}

pyproject.toml

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
[build-system]
2+
requires = [
3+
"hatchling>=1.8.0",
4+
]
5+
build-backend = "hatchling.build"
6+
7+
[project]
8+
name = "hatch-semver"
9+
description = "Hatch plugin for semver versioning scheme"
10+
readme = "README.md"
11+
license = "MIT"
12+
requires-python = ">=3.9"
13+
authors = [
14+
{ name = "Sven Siegmund", email = "[email protected]" },
15+
]
16+
17+
keywords = [
18+
"hatch",
19+
"plugin",
20+
"version",
21+
"development",
22+
"versioning",
23+
]
24+
25+
classifiers = [
26+
"Development Status :: 3 - Alpha",
27+
#"Development Status :: 4 - Beta",
28+
#"Development Status :: 5 - Production/Stable",
29+
"Intended Audience :: Developers",
30+
"Topic :: Software Development",
31+
"Framework :: Hatch",
32+
"License :: OSI Approved :: MIT License",
33+
"Natural Language :: English",
34+
"Programming Language :: Python :: 3.9",
35+
"Operating System :: OS Independent",
36+
"Operating System :: Microsoft :: Windows",
37+
"Operating System :: POSIX :: Linux",
38+
"Operating System :: MacOS :: MacOS X",
39+
]
40+
41+
dependencies = [
42+
"hatchling",
43+
"semver",
44+
]
45+
46+
dynamic = [
47+
"version",
48+
]
49+
50+
[project.urls]
51+
Homepage = "https://github.com/Nagidal/hatch-semver"
52+
Issues = "https://github.com/Nagidal/hatch-semver/issues"
53+
54+
[project.entry-points.hatch]
55+
semver = "hatch_semver.hooks"
56+
57+
[project.scripts]
58+
59+
[tool.hatch.version]
60+
path = "src/hatch-semver/__about__.py"
61+
62+
[tool.hatch.envs.default]
63+
dependencies = [
64+
"pytest",
65+
"pytest-cov",
66+
"wheel",
67+
"towncrier",
68+
]
69+
70+
[tool.hatch.envs.default.scripts]
71+
cov = "pytest -v --cov-report=term-missing --cov-config=pyproject.toml --cov=src/hatch-semver --cov=tests"
72+
no-cov = "cov --no-cov"
73+
74+
[tool.hatch.envs.style]
75+
dependencies = [
76+
"black",
77+
"isort",
78+
]
79+
80+
[tool.hatch.envs.style.scripts]
81+
fmt = [
82+
"isort .",
83+
"black .",
84+
]
85+
86+
[tool.hatch.envs.docs]
87+
dependencies = [
88+
"pdoc3"
89+
]
90+
91+
[tool.hatch.envs.docs.scripts]
92+
build = "pdoc --html --output-dir docs hatch-semver"
93+
serve = "pdoc --http : hatch-semver"
94+
95+
[[tool.hatch.envs.test.matrix]]
96+
python = ["39", "310"]
97+
98+
[tool.coverage.run]
99+
branch = true
100+
parallel = true
101+
omit = [
102+
#"src/hatch-semver/__about__.py",
103+
]
104+
105+
[tool.coverage.report]
106+
exclude_lines = [
107+
"no cov",
108+
"if __name__ == .__main__.:",
109+
"if TYPE_CHECKING:",
110+
]
111+
112+
[tool.black]
113+
line-length = 102
114+
115+
[tool.isort]
116+
line-length = 102
117+
118+
[tool.towncrier]
119+
name = "hatch-semver"
120+
package = "hatch-semver"
121+
package_dir = "src"
122+
directory = "changelog.d"
123+
filename = "CHANGELOG.md"
124+
start_string = "<!-- towncrier release notes start -->\n"
125+
underlines = ["", "", ""]
126+
template = "changelog.d/changelog_template.jinja"
127+
title_format = "## [{version}](https://github.com/Nagidal/hatch-semver/tree/{version}) - {project_date}"
128+
issue_format = "[#{issue}](https://github.com/Nagidal/hatch-semver/issues/{issue})"
129+
orphan_prefix = "+"
130+
131+
[tool.towncrier.fragment.doc]
132+
name = "Documentation"
133+
showcontent = true
134+
135+
[tool.towncrier.fragment.feature]
136+
name = "New Features"
137+
showcontent = true
138+
139+
[tool.towncrier.fragment.improved]
140+
name = "Improvements"
141+
showcontent = true
142+
143+
[tool.towncrier.fragment.fixed]
144+
name = "Bugfixes"
145+
showcontent = true
146+
147+
[tool.towncrier.fragment.detail]
148+
name = "Development Details"
149+
showcontent = true

src/hatch-semver/__about__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env python
2+
3+
4+
from datetime import date
5+
6+
__author__ = "Sven Siegmund"
7+
__author_email__ = "[email protected]"
8+
__maintainer__ = __author__
9+
__maintainer_email__ = __author_email__
10+
__release_date__ = date(year=2022, month=11, day=10)
11+
__version__ = "0.0.1"
12+

src/hatch-semver/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env python
2+
3+
4+
"""
5+
### hatch-semver
6+
Plugin for hatch to support semantic versioning scheme
7+
"""
8+
9+
# towncrier is looking for the version number in here
10+
from .__about__ import __version__
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#!/usr/bin/env python

0 commit comments

Comments
 (0)