Skip to content

Commit 206bcd8

Browse files
authored
feat: Updates docs and workflows (#9)
* feat: Updates docs and workflows * fix: Changes after review
1 parent e6c7740 commit 206bcd8

File tree

9 files changed

+48
-36
lines changed

9 files changed

+48
-36
lines changed

.github/workflows/build.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: Build PyPI
22
on:
3-
workflow_call:
3+
workflow_call:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
types:
8+
- opened
9+
- reopened
10+
- synchronize
411

512
jobs:
613
linting:
@@ -20,8 +27,9 @@ jobs:
2027
with:
2128
python-version: "3.10"
2229
- name: Install dependencies
23-
run: |
24-
pip install hatch
30+
run: pip install hatch
31+
- name: Run unit and integrations tests
32+
run: hatch run test:pytest --cov=reqstool-python-decorators --cov-report=xml --cov-report=html
2533
- name: Build project
2634
run: hatch build
2735
# Upload artifacts for later use
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Lint (black and flake8)
2+
on:
3+
workflow_call:
4+
5+
jobs:
6+
check-release:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Check branch and tag
10+
if: github.event_name == 'push' && !(github.ref == 'refs/heads/main' && startsWith(github.ref, 'refs/tags/v'))
11+
run: exit 1

.github/workflows/lint.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
name: Linting (black and flake8)
1+
name: Lint (black and flake8)
22
on:
3+
workflow_dispatch:
34
workflow_call:
45

56
jobs:
@@ -17,6 +18,4 @@ jobs:
1718
- name: Run black formatter check
1819
run: hatch run lint:black --check --verbose src tests
1920
- name: Run flake8 linter
20-
run: hatch run lint:flake8
21-
- name: Run unit and integrations tests
22-
run: hatch run test:pytest --cov=reqstool-python-decorators --cov-report=xml --cov-report=html
21+
run: hatch run lint:flake8
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
name: Publish to GitHub Pages
22
on:
3+
workflow_dispatch:
4+
release:
5+
types: [created]
36
push:
47
branches:
58
- main
6-
pull_request:
7-
branches:
8-
- main
99

10-
# Allows you to run this workflow manually from the Actions tab
11-
workflow_dispatch:
1210
concurrency:
1311
group: github-pages
1412
cancel-in-progress: false
@@ -18,7 +16,7 @@ permissions:
1816
pages: write
1917
id-token: write
2018
jobs:
21-
build:
19+
publish-gh-pages:
2220
runs-on: ubuntu-latest
2321
environment:
2422
name: github-pages
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
name: Build and publish to PyPI
22

33
on:
4-
push:
5-
branches:
6-
- main
7-
tags:
8-
- "v*.*.*"
4+
release:
5+
types: [created]
96

107
jobs:
8+
check-release:
9+
name: Reuse check release
10+
uses: ./.github/workflows/check_release.yml
1111
build:
1212
name: Reuse build
1313
uses: ./.github/workflows/build.yml
14+
1415

1516
publish-to-pypi:
16-
needs: build
17+
needs:
18+
- check-release
19+
- build
1720
runs-on: ubuntu-latest
1821
environment:
19-
name: production
22+
name: prod
2023
url: https://pypi.org/p/reqstool-python-decorators
2124
permissions:
2225
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
name: Build and publish to Test PyPI
22

33
on:
4-
push:
5-
branches-ignore:
6-
- main
7-
pull_request:
8-
types:
9-
- opened
10-
- reopened
11-
- synchronize
4+
workflow_dispatch:
125

136
jobs:
147
build:
@@ -20,7 +13,7 @@ jobs:
2013
runs-on: ubuntu-latest
2114
# Specifying a GitHub environment is optional, but strongly encouraged
2215
environment:
23-
name: development
16+
name: test
2417
url: https://test.pypi.org/p/reqstool-python-decorators
2518
permissions:
2619
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

docs/antora-playbook.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# yaml-language-server: $schema=https://raw.githubusercontent.com/asciidoctor/asciidoctor-intellij-plugin/main/src/main/resources/jsonSchemas/antoraPlaybookSchema.json
22

33
site:
4-
title: Requirements Tool Documentation
4+
title: Reqstool Python Decorators Documentation
55
url: https://github.com/Luftfartsverket/reqstool-python-decorators.git
66
start_page: reqstool-python-decorators::index.adoc
77

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
== Installation
22

3-
The package name is `reqstool-decorators`.
3+
The package name is `reqstool-python-decorators`.
44

55
* Using pip install:
66
77
```
8-
$pip install reqstool-decorators
8+
$pip install reqstool-python-decorators
99
```

docs/modules/ROOT/pages/usage.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@
66

77
```
88
dependencies = [
9-
"reqstool-decorators == <version>"
9+
"reqstool-python-decorators == <version>"
1010
]
1111
```
1212

1313
* Poetry
1414

1515
```
1616
[tool.poetry.dependencies]
17-
reqstool-decorators = "<version>"
17+
reqstool-python-decorators = "<version>"
1818
```
1919

2020
=== Decorators
2121

2222
Import decorators:
2323

2424
```
25-
from reqstool-decorators.decorators.decorators import Requirements, SVCs
25+
from reqstool_python_decorators.decorators.decorators import Requirements, SVCs
2626
```
2727

2828
Example usage of the decorators:
@@ -42,7 +42,7 @@ def test_somefunction():
4242
Import processor:
4343

4444
```
45-
from reqstool.processors.decorator_processor import ProcessDecorator
45+
from reqstool_python_decorators.processors.decorator_processor import ProcessDecorator
4646
```
4747

4848
Main function to collect decorators data and generate yaml file:

0 commit comments

Comments
 (0)