Skip to content

Commit b3aad6a

Browse files
fleetingbytesSven Siegmund
andauthored
Develop (#92)
closes #91 * looks testable to me * v0.0.2 * updated changelog * renamed module * v0.0.3 * rough outline * changelog * fixed #10 * changelog * news fragment * changelog * added news fragment * changelog * fixed #14 * changelog * added few testcases, more to come * wrote some more tests * Basics are done, now the documentation * renamed details to unimportant because of alphabetical section ordering * updated changelog * fixed isort setting * written some docs, abandoning portray * documentation done * docs done * removed portray * version 0.2.0 ready * moved user-docs * updated pyproject * removed api docs * removed api docs * well formatted * fixed #31 * tc script * switching to hatch-semver * release candidate ready * v0.2.4 * testing a ci * changes to mkdocs.yaml * added author * changed doc pipeline * fixes #44, fixes #46, fixes #47 * i guess, it's an update * changed admonition to note * news fragment * updated tc script * test stage set up * modified docs:tc script * pull_request instead of pull-request * v20201129 * installing hatch * dropped stupid actions * try this * try that * maybe this will please GH * no parallel * restructured * maybe now * python versions as string * calling pytest * installing self * installing cwd * v1.0.0 * Fixed typos and errors, fixes #59 * tests for about and changelog, links in pyproject.toml updated * committing, maybe * maybe the ref develop is not necessary * fixed typo in doc * Testlint (#71) added a linting stage * Noflake8 (#72) need to merge this even it test failed * Noflake8 (#73) should be ok now * style: prepare for newline conversion * updated changelog * docs: update changelog --------- Co-authored-by: Sven Siegmund <[email protected]>
1 parent 486abef commit b3aad6a

29 files changed

+1562
-1461
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.githooks/pre-commit

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
#!/bin/sh
2-
# Copy or link this script into .git/hooks/
3-
# It runs automatically in the project root directory (parent of .git/).
4-
5-
6-
# Format python code
7-
black .
8-
black_retval=$?
9-
if [ $black_retval -ne 0 ]; then
10-
exit 1
11-
fi
12-
13-
# Sort imports
14-
isort .
15-
isort_retval=$?
16-
if [ $isort_retval -ne 0 ]; then
17-
exit 1
18-
fi
19-
20-
# add updated files
21-
git add -u
1+
#!/bin/sh
2+
# Copy or link this script into .git/hooks/
3+
# It runs automatically in the project root directory (parent of .git/).
4+
5+
6+
# Format python code
7+
black .
8+
black_retval=$?
9+
if [ $black_retval -ne 0 ]; then
10+
exit 1
11+
fi
12+
13+
# Sort imports
14+
isort .
15+
isort_retval=$?
16+
if [ $isort_retval -ne 0 ]; then
17+
exit 1
18+
fi
19+
20+
# add updated files
21+
git add -u

.github/workflows/develop.yml

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
1-
name: Develop Workflow
2-
on:
3-
push:
4-
branches:
5-
- develop
6-
7-
jobs:
8-
test:
9-
strategy:
10-
matrix:
11-
python-version:
12-
- "3.9"
13-
- "3.10"
14-
- "3.11"
15-
runs-on: ubuntu-latest
16-
steps:
17-
- name: Checkout repository
18-
uses: actions/checkout@v3
19-
- name: Set up python
20-
uses: actions/setup-python@v4
21-
with:
22-
python-version: ${{ matrix.python-version }}
23-
- name: Install dependencies
24-
run: |
25-
python -m pip install --upgrade pip
26-
pip install wheel
27-
pip install hatch pytest pytest-cov
28-
pip install .
29-
- name: Test with pytest
30-
run: |
31-
pytest -v --cov-report= --cov=hatch_semver tests/
32-
coverage-finish:
33-
needs: test
34-
runs-on: ubuntu-latest
35-
name: Finish coverage
36-
steps:
37-
- run: echo Test was OK
1+
name: Testing
2+
on:
3+
pull_request:
4+
branches:
5+
- develop
6+
- master
7+
8+
jobs:
9+
test:
10+
strategy:
11+
matrix:
12+
python-version:
13+
- "3.9"
14+
- "3.10"
15+
- "3.11"
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
- name: Set up python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install wheel
28+
pip install hatch pytest pytest-cov
29+
pip install .
30+
- name: Test with pytest
31+
run: |
32+
pytest -v --cov-report= --cov=hatch_semver tests/
33+
coverage-finish:
34+
needs: test
35+
runs-on: ubuntu-latest
36+
name: Finish coverage
37+
steps:
38+
- run: echo Test was OK

.github/workflows/lint.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Lint
2+
3+
on:
4+
pull_request_target:
5+
branches:
6+
- develop
7+
- master
8+
9+
jobs:
10+
lint:
11+
name: Linting
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Check out git repository
16+
uses: actions/checkout@v3
17+
- name: Set up Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: "3.11"
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install wheel
25+
pip install black isort
26+
- name: Run Black
27+
uses: wearerequired/[email protected]
28+
with:
29+
continue_on_error: false
30+
black: true
31+
- name: Run isort
32+
uses: isort/[email protected]
Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
name: Master PR Closed Workflow
2-
on:
3-
pull_request:
4-
types:
5-
- closed
6-
branches:
7-
- master
8-
9-
jobs:
10-
doc_gen:
11-
name: Generate User Documentation
12-
if: github.event.pull_request.merged == true
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v3
16-
- uses: actions/setup-python@v4
17-
with:
18-
python-version: 3.x
19-
- run: pip install --upgrade pip
20-
- run: pip install mkdocs-material
21-
- run: mkdocs gh-deploy --force --clean
1+
name: Master PR Closed Workflow
2+
on:
3+
pull_request:
4+
types:
5+
- closed
6+
branches:
7+
- master
8+
9+
jobs:
10+
doc_gen:
11+
name: Generate User Documentation
12+
if: github.event.pull_request.merged == true
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-python@v4
17+
with:
18+
python-version: "3.11"
19+
- run: pip install --upgrade pip
20+
- run: pip install mkdocs-material
21+
- run: mkdocs gh-deploy --force --clean

.pre-commit-config.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.3.0
4+
hooks:
5+
- id: check-yaml
6+
- id: check-toml
7+
- id: check-merge-conflict
8+
- id: check-byte-order-marker
9+
- repo: https://github.com/Lucas-C/pre-commit-hooks
10+
rev: v1.3.1
11+
hooks:
12+
- id: remove-crlf
13+
- repo: https://github.com/jumanjihouse/pre-commit-hooks
14+
rev: 3.0.0
15+
hooks:
16+
- id: markdownlint
17+
- repo: https://github.com/psf/black
18+
rev: 22.10.0
19+
hooks:
20+
- id: black
21+
- repo: https://github.com/pycqa/isort
22+
rev: 5.10.1
23+
hooks:
24+
- id: isort

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
<!-- towncrier release notes start -->
44

5+
## [2.0.1](https://github.com/fleetingbytes/hatch-semver/tree/2.0.1) - 2024-02-17
6+
7+
8+
### Bugfixes
9+
10+
- release a version not dependent on itself [#90](https://github.com/fleetingbytes/hatch-semver/issues/90)
11+
12+
13+
### Development Details
14+
15+
- use unix newlines [#91](https://github.com/fleetingbytes/hatch-semver/issues/91)
16+
517
## [2.0.0](https://github.com/fleetingbytes/hatch-semver/tree/2.0.0) - 2024-02-03
618

719

README.md

Lines changed: 62 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
1-
# hatch-semver
2-
3-
A plugin for [hatch][hatch] to support [semantic versioning][semver]. Hatch-semver relies on [python-semver][python-semver] for all the versioning logic.
4-
5-
## Setup
6-
7-
Introduce hatch-semver as a build-dependency to your project (in your `pyproject.toml`):
8-
9-
```toml
10-
[build-system]
11-
requires = [
12-
"hatchling",
13-
"hatch-semver",
14-
]
15-
build-backend = "hatchling.build"
16-
```
17-
18-
Further down in `pyproject.toml`,
19-
where you set up the *hatch version* command,
20-
set version scheme to `semver`:
21-
```toml
22-
[tool.hatch.version]
23-
path = "src/<your_project>/__about__.py"
24-
validate-bump = true
25-
scheme = "semver"
26-
```
27-
28-
### Beware
29-
30-
Hatch-semver plugin will only work with project versions which can be readily parsed by [python-semver][python-semver].
31-
Therefore, if you are introducing hatch-semver into an existing project, you must **make sure that the project's current version is a valid semantic version.**
32-
You can test that [here][semver-regex].
33-
34-
## Quick Start
35-
36-
Many of hatch's [standard versioning][hatch_versioning] commands also work for hatch-semver to bump your project's version in a semver-compliant way.
37-
Such command is written as a single string of comma-separated bump instructions as a positional argument of the `hatch version` subcommand, i.e `hatch version <COMMAND>`.
38-
39-
Starting with `0.1.0` as the original version, here is a series of example commands which illustrate some common ways how to bump the version:
40-
41-
| Old Version | Command | New Version |
42-
| ---------------------- | ------------------- | -------------------- |
43-
| `0.1.0` | `patch` | `0.1.1` |
44-
| `0.1.1` | `minor,patch,patch` | `0.2.2` |
45-
| `0.2.2` | `minor` | `0.3.0` |
46-
| `0.3.0` | `rc` | `0.3.1-rc.1` |
47-
| `0.3.1-rc.1` | `rc` | `0.3.1-rc.2` |
48-
| `0.3.1-rc.2` | `release` | `0.3.1` |
49-
| `0.3.1` | `0.9.5` | `0.9.5` |
50-
| `0.9.5` | `major,rc` | `1.0.0-rc.1` |
51-
| `1.0.0-rc.1` | `release` | `1.0.0` |
52-
53-
See the [command reference][commands] for all the commands in full detail. If you are familiar with hatch's standard versioning scheme, perhaps a [comparison][comparison] of the standard scheme and hatch-semver will be of interest.
54-
55-
56-
[hatch]: https://hatch.pypa.io/
57-
[hatch_versioning]: https://hatch.pypa.io/latest/version/#updating
58-
[python-semver]: https://github.com/python-semver/python-semver/tree/maint/v2
59-
[semver-regex]: https://regex101.com/r/Ly7O1x/3/
60-
[semver]: https://semver.org/
61-
[commands]: https://fleetingbytes.github.io/hatch-semver/user_guide/1-commands/
62-
[comparison]: https://fleetingbytes.github.io/hatch-semver/user_guide/2-migrating-to-semver/
1+
# hatch-semver
2+
3+
A plugin for [hatch][hatch] to support [semantic versioning][semver]. Hatch-semver relies on [python-semver][python-semver] for all the versioning logic.
4+
5+
## Setup
6+
7+
Introduce hatch-semver as a build-dependency to your project (in your `pyproject.toml`):
8+
9+
```toml
10+
[build-system]
11+
requires = [
12+
"hatchling",
13+
"hatch-semver",
14+
]
15+
build-backend = "hatchling.build"
16+
```
17+
18+
Further down in `pyproject.toml`,
19+
where you set up the *hatch version* command,
20+
set version scheme to `semver`:
21+
```toml
22+
[tool.hatch.version]
23+
path = "src/<your_project>/__about__.py"
24+
validate-bump = true
25+
scheme = "semver"
26+
```
27+
28+
### Beware
29+
30+
Hatch-semver plugin will only work with project versions which can be readily parsed by [python-semver][python-semver].
31+
Therefore, if you are introducing hatch-semver into an existing project, you must **make sure that the project's current version is a valid semantic version.**
32+
You can test that [here][semver-regex].
33+
34+
## Quick Start
35+
36+
Many of hatch's [standard versioning][hatch_versioning] commands also work for hatch-semver to bump your project's version in a semver-compliant way.
37+
Such command is written as a single string of comma-separated bump instructions as a positional argument of the `hatch version` subcommand, i.e `hatch version <COMMAND>`.
38+
39+
Starting with `0.1.0` as the original version, here is a series of example commands which illustrate some common ways how to bump the version:
40+
41+
| Old Version | Command | New Version |
42+
| ---------------------- | ------------------- | -------------------- |
43+
| `0.1.0` | `patch` | `0.1.1` |
44+
| `0.1.1` | `minor,patch,patch` | `0.2.2` |
45+
| `0.2.2` | `minor` | `0.3.0` |
46+
| `0.3.0` | `rc` | `0.3.1-rc.1` |
47+
| `0.3.1-rc.1` | `rc` | `0.3.1-rc.2` |
48+
| `0.3.1-rc.2` | `release` | `0.3.1` |
49+
| `0.3.1` | `0.9.5` | `0.9.5` |
50+
| `0.9.5` | `major,rc` | `1.0.0-rc.1` |
51+
| `1.0.0-rc.1` | `release` | `1.0.0` |
52+
53+
See the [command reference][commands] for all the commands in full detail. If you are familiar with hatch's standard versioning scheme, perhaps a [comparison][comparison] of the standard scheme and hatch-semver will be of interest.
54+
55+
56+
[hatch]: https://hatch.pypa.io/
57+
[hatch_versioning]: https://hatch.pypa.io/latest/version/#updating
58+
[python-semver]: https://github.com/python-semver/python-semver/tree/maint/v2
59+
[semver-regex]: https://regex101.com/r/Ly7O1x/3/
60+
[semver]: https://semver.org/
61+
[commands]: https://fleetingbytes.github.io/hatch-semver/user_guide/1-commands/
62+
[comparison]: https://fleetingbytes.github.io/hatch-semver/user_guide/2-migrating-to-semver/

changelog.d/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
!.gitignore
1+
!.gitignore
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +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 %}
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 %}

0 commit comments

Comments
 (0)