Skip to content

Commit 4e313a2

Browse files
committed
fix docs build and docs around standards, towncrier, etc.
1 parent 74fda9b commit 4e313a2

File tree

7 files changed

+94
-59
lines changed

7 files changed

+94
-59
lines changed

docs/admin/install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Option 2: Manually install via Poetry.
1111
```
1212
git clone https://github.com/networktocode/pyntc.git
1313
cd pyntc
14-
pip install poetry
14+
curl -sSL https://install.python-poetry.org | python3 -
1515
poetry install
1616
```
1717

docs/dev/contributing.md

Lines changed: 34 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,44 @@ Pull requests are welcomed and automatically built and tested against multiple v
44

55
Except for unit tests, testing is only supported on Python 3.9.
66

7-
The project is packaged with a light development environment based on `Docker` to help with the local development of the project and to run tests within GitHub Actions.
7+
The project is packaged with a light development environment based on `Docker` to help with the local development of the project and to run tests within GitHub Actions.
88

9-
The project is following Network to Code software development guidelines and are leveraging the following:
9+
The project is following Network to Code software development guidelines and is leveraging the following:
1010

11-
- Black, Pylint, Bandit, flake8, and pydocstyle for Python linting and formatting.
12-
- pytest, coverage, and unittest for unit tests.
11+
- Python linting and formatting: `pylint` and `ruff`.
12+
- YAML linting is done with `yamllint`.
1313

1414
Documentation is built using [mkdocs](https://www.mkdocs.org/). The [Docker based development environment](dev_environment.md#docker-development-environment) can be started by running `invoke docs` [http://localhost:8001](http://localhost:8001) that auto-refreshes when you make any changes to your local files.
1515

16+
## Creating Changelog Fragments
17+
18+
All pull requests to `next` or `develop` must include a changelog fragment file in the `./changes` directory. To create a fragment, use your GitHub issue number and fragment type as the filename. For example, `2362.added`. Valid fragment types are `added`, `changed`, `deprecated`, `fixed`, `removed`, and `security`. The change summary is added to the file in plain text. Change summaries should be complete sentences, starting with a capital letter and ending with a period, and be in past tense. Each line of the change fragment will generate a single change entry in the release notes. Use multiple lines in the same file if your change needs to generate multiple release notes in the same category. If the change needs to create multiple entries in separate categories, create multiple files.
19+
20+
!!! example
21+
22+
**Wrong**
23+
```plaintext title="changes/1234.fixed"
24+
fix critical bug in documentation
25+
```
26+
27+
**Right**
28+
```plaintext title="changes/1234.fixed"
29+
Fixed critical bug in documentation.
30+
```
31+
32+
!!! example "Multiple Entry Example"
33+
34+
This will generate 2 entries in the `fixed` category and one entry in the `changed` category.
35+
36+
```plaintext title="changes/1234.fixed"
37+
Fixed critical bug in documentation.
38+
Fixed release notes generation.
39+
```
40+
41+
```plaintext title="changes/1234.changed"
42+
Changed release notes generation.
43+
```
44+
1645
## Branching Policy
1746

1847
The branching policy includes the following tenets:
@@ -45,4 +74,4 @@ When a new release is created the following should happen.
4574
- A post release PR is created with.
4675
- Change the version from `<major>.<minor>.<patch>` to `<major>.<minor>.<patch + 1>-beta` pyproject.toml.
4776
- Set the PR to the `develop`.
48-
- Once tests pass, merge.
77+
- Once tests pass, merge.

docs/dev/dev_environment.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ Once you have Poetry and Docker installed you can run the following commands (in
3232
```shell
3333
poetry shell
3434
poetry install
35-
cp development/creds.example.env development/creds.env
3635
invoke build
3736
invoke start
3837
```
@@ -51,7 +50,7 @@ Poetry is used in lieu of the "virtualenv" commands and is leveraged in both env
5150
The `pyproject.toml` file outlines all of the relevant dependencies for the project:
5251

5352
- `tool.poetry.dependencies` - the main list of dependencies.
54-
- `tool.poetry.dev-dependencies` - development dependencies, to facilitate linting, testing, and documentation building.
53+
- `tool.poetry.group.dev.dependencies` - development dependencies, to facilitate linting, testing, and documentation building.
5554

5655
The `poetry shell` command is used to create and enable a virtual environment managed by Poetry, so all commands ran going forward are executed within the virtual environment. This is similar to running the `source venv/bin/activate` command with virtualenvs. To install project dependencies in the virtual environment, you should run `poetry install` - this will install **both** project and development dependencies.
5756

@@ -82,21 +81,18 @@ Each command can be executed with `invoke <command>`. Each command also has its
8281
### Utility
8382

8483
```
85-
cli Enter the image to perform troubleshooting or dev work.
86-
clean-container Remove stopped containers that source for image `pyntc:`
84+
cli Enter the image to perform troubleshooting or dev work.
85+
clean Remove stopped containers that source for image `pyntc:`
86+
generate-release-notes Generate Release Notes using Towncrier.
8787
```
8888

8989
### Testing
9090

9191
```
92-
bandit Run bandit to validate basic static code security analysis.
93-
black Run black to check that Python files adhere to its style standards.
94-
coverage Run the coverage report against pytest.
95-
flake8 Run flake8 to check that Python files adhere to its style standards.
96-
mypy Run mypy to validate typing-hints.
97-
pylint Run pylint code analysis.
98-
pydocstyle Run pydocstyle to validate docstring formatting adheres to NTC defined standards.
99-
pytest Run pytest for the specified name and Python version.
100-
tests Run all tests for the specified name and Python version.
101-
yamllint Run yamllint to validate formatting adheres to NTC defined YAML standards.
92+
autoformat (a) Run code autoformatting.
93+
pylint Run pylint for the specified name and Python version.
94+
ruff Run ruff to perform code formatting and/or linting.
95+
pytest Run pytest for the specified name and Python version.
96+
tests Run all tests for the specified name and Python version.
97+
yamllint Run yamllint to validate formatting adheres to NTC defined YAML standards.
10298
```

docs/requirements.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
mkdocs==1.6.0
2-
# Material for MkDocs theme
32
mkdocs-material==9.5.32
4-
# Render custom markdown for version added/changed/remove notes
5-
mkdocs-version-annotations==1.0.0
6-
# Automatic documentation from sources, for MkDocs
7-
mkdocstrings==0.25.2
3+
markdown-version-annotations==1.0.1
4+
griffe==1.1.1
85
mkdocstrings-python==1.10.8
9-
griffe==1.1.1
6+
mkdocstrings==0.25.2
7+
mkdocs-autorefs==1.2.0
8+
# Unique requirements
9+
mkdocs-python-classy==0.1.3

mkdocs.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,14 @@ theme:
1414
- "python"
1515
- "yaml"
1616
features:
17-
- "navigation.tracking"
17+
- "content.code.copy"
18+
- "navigation.indexes"
1819
- "navigation.tabs"
1920
- "navigation.tabs.sticky"
20-
- "search.suggest"
21+
- "navigation.tracking"
2122
- "search.highlight"
2223
- "search.share"
23-
- "navigation.indexes"
24+
- "search.suggest"
2425
favicon: "assets/favicon.ico"
2526
logo: "assets/networktocode_logo.svg"
2627
palette:
@@ -88,7 +89,10 @@ plugins:
8889
python:
8990
paths: ["."]
9091
options:
92+
heading_level: 1
9193
show_root_heading: true
94+
show_root_members_full_path: true
95+
show_source: false
9296
watch:
9397
- "README.md"
9498

poetry.lock

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,7 @@ pyntc = 'pyntc.cli:main'
4343
requests_mock = "*"
4444
pytest = "*"
4545
mock = "*"
46-
mkdocs = "^1.6.0"
47-
mkdocs-material = "9.5.32"
48-
mkdocstrings = "0.25.2"
49-
mkdocstrings-python = "1.10.8"
5046
griffe = "1.1.1"
51-
markdown-data-tables = "^1.0.0"
52-
mkdocs-version-annotations = "^1.0.0"
5347
pyyaml = "^6.0.1"
5448
pylint = "^3.1.0"
5549
yamllint = "^1.35.1"
@@ -58,6 +52,18 @@ toml = "^0.10.2"
5852
attrs = "^23.2.0"
5953
towncrier = "^24.8.0"
6054
ruff = "*"
55+
Markdown = "*"
56+
# Render custom markdown for version added/changed/remove notes
57+
mkdocs-version-annotations = "^1.0.0"
58+
# Rendering docs to HTML
59+
mkdocs = "^1.6.0"
60+
# Material for MkDocs theme
61+
mkdocs-material = "9.5.32"
62+
# Automatic documentation from sources, for MkDocs
63+
mkdocstrings = "0.25.2"
64+
mkdocstrings-python = "1.10.8"
65+
mkdocs-autorefs = "1.2.0"
66+
markdown-data-tables = "^1.0.0"
6167

6268
[tool.pyntc]
6369
string_required = "some string"

0 commit comments

Comments
 (0)