Skip to content

Commit 7b298e3

Browse files
committed
Updating name and repo settings
1 parent 18e7a9c commit 7b298e3

19 files changed

+581
-109
lines changed

.coveragerc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[run]
22
source =
3-
ansys.xml.ast
3+
ansys.dita.ast
44

55
[report]
66
show_missing = true

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip" # See documentation for possible values
4+
directory: "/" # Location of package manifests
5+
insecure-external-code-execution: allow
6+
schedule:
7+
interval: "weekly"
8+
labels:
9+
- "maintenance"
10+
- "dependencies"
11+
12+
- package-ecosystem: "github-actions"
13+
directory: "/"
14+
schedule:
15+
interval: "weekly"

.github/labeler.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Documentation:
2+
- doc/source/**/*
3+
Maintenance:
4+
- .github/**/*
5+
- .flake8
6+
- doc/styles/**/*
7+
- pyproject.toml
8+
Dependencies:
9+
- pyproject.toml
10+
CI/CD:
11+
- .github/**/*

.github/labels.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
- name: bug
2+
description: Something isn't working
3+
color: d42a34
4+
5+
- name: dependencies
6+
description: Related with project dependencies
7+
color: ffc0cb
8+
9+
- name: documentation
10+
description: Improvements or additions to documentation
11+
color: 0677ba
12+
13+
- name: enhancement
14+
description: New features or code improvements
15+
color: FFD827
16+
17+
- name: good first issue
18+
description: Easy to solve for newcomers
19+
color: 62ca50
20+
21+
- name: maintenance
22+
description: Package and maintenance related
23+
color: f78c37
24+
25+
- name: release
26+
description: Anything related to an incoming release
27+
color: ffffff

.github/workflows/ci_cd.yml

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
# check spelling, codestyle
2+
name: GitHub CI
3+
4+
# run only on main branch. This avoids duplicated actions on PRs
5+
on:
6+
workflow_dispatch:
7+
schedule: # UTC at 0300
8+
- cron: "0 3 * * *"
9+
pull_request:
10+
push:
11+
tags:
12+
- "*"
13+
branches:
14+
- main
15+
16+
env:
17+
MAIN_PYTHON_VERSION: '3.9'
18+
PACKAGE_NAME: 'ansys-dita-ast'
19+
PACKAGE_NAMESPACE: 'ansys.dita.ast'
20+
RESET_PIP_CACHE: 0
21+
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.ref }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
28+
code-style:
29+
name: "Code style"
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: PyAnsys code style checks
33+
uses: pyansys/actions/code-style@v4
34+
with:
35+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
36+
37+
38+
39+
smoke-tests:
40+
name: Build and Smoke tests (Linux)
41+
runs-on: ubuntu-latest
42+
needs: [code-style]
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
python-version: ['3.8', '3.9', '3.10', '3.11']
47+
48+
steps:
49+
- name: Build wheelhouse and perform smoke test
50+
uses: pyansys/actions/build-wheelhouse@v4
51+
with:
52+
library-name: ${{ env.PACKAGE_NAME }}
53+
library-namespace: ${{ env.PACKAGE_NAMESPACE }}
54+
operating-system: ${{ runner.os }}
55+
python-version: ${{ matrix.python-version }}
56+
57+
58+
smoke-tests-macos-windows:
59+
name: Build and Smoke tests (macOS and Windows)
60+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
61+
runs-on: ${{ matrix.os }}
62+
needs: [code-style]
63+
strategy:
64+
fail-fast: false
65+
matrix:
66+
os: [windows-latest, macos-latest]
67+
python-version: ['3.8', '3.9', '3.10', '3.11']
68+
69+
steps:
70+
- name: Build wheelhouse and perform smoke test
71+
uses: pyansys/actions/build-wheelhouse@v4
72+
with:
73+
library-name: ${{ env.PACKAGE_NAME }}
74+
library-namespace: ${{ env.PACKAGE_NAMESPACE }}
75+
operating-system: ${{ matrix.os }}
76+
python-version: ${{ matrix.python-version }}
77+
78+
79+
build-test:
80+
name: "Build and unit testing"
81+
runs-on: ubuntu-latest
82+
needs: [smoke-tests]
83+
84+
steps:
85+
- name: "Install Git and checkout project"
86+
uses: actions/checkout@v3
87+
88+
- name: "Setup Python"
89+
uses: actions/setup-python@v4
90+
with:
91+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
92+
93+
- name: "Install os packages"
94+
run: |
95+
sudo apt update
96+
sudo apt-get install pandoc
97+
98+
- name: "Cache pip"
99+
uses: actions/cache@v3
100+
with:
101+
path: ~/.cache/pip
102+
key: Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}-${{ hashFiles('pyproject.toml') }}
103+
restore-keys: |
104+
Python-v${{ env.RESET_PIP_CACHE }}-${{ runner.os }}
105+
106+
# The token will expire in 2024.
107+
- name: "Checkout pydita-ast repository"
108+
uses: actions/checkout@v3
109+
with:
110+
repository: pyansys/pydita-ast
111+
token: ${{ secrets.DITA_AST_DOC_TOKEN }}
112+
path: pydita-ast
113+
114+
- name: "Unit testing requirements installation"
115+
run: |
116+
python -m pip install .[tests]
117+
118+
- name: "Unit testing"
119+
run: |
120+
pytest -v --durations=10 --maxfail=10 \
121+
--reruns 7 --reruns-delay 3 --ghdir ${{ github.workspace }} \
122+
--cov=ansys.dita.ast --cov-report=xml:centos-remote.xml --cov-report=html
123+
124+
- name: "Upload coverage to Codecov"
125+
uses: codecov/codecov-action@v3
126+
with:
127+
name: centos-remote.xml
128+
flags: centos,remote
129+
130+
- name: Upload coverage artifacts
131+
uses: actions/upload-artifact@v3
132+
with:
133+
name: centos-remote.xml
134+
path: ./centos-remote.xml
135+
136+
137+
package:
138+
name: Package library
139+
needs: [build-test]
140+
runs-on: ubuntu-latest
141+
steps:
142+
- name: Build library source and wheel artifacts
143+
uses: pyansys/actions/build-library@v4
144+
with:
145+
library-name: ${{ env.PACKAGE_NAME }}
146+
python-version: ${{ env.MAIN_PYTHON_VERSION }}
147+
148+
149+
release:
150+
name: "Release project to private PyPI and GitHub"
151+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
152+
needs: [package, smoke-tests-macos-windows]
153+
runs-on: ubuntu-latest
154+
steps:
155+
156+
- name: "Release to the private PyPI repository"
157+
uses: pyansys/actions/release-pypi-private@v4
158+
with:
159+
library-name: ${{ env.PACKAGE_NAME }}
160+
twine-username: "__token__"
161+
twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}
162+
163+
164+
# - name: "Release to the public PyPI repository"
165+
# uses: pyansys/actions/release-pypi-public@v3
166+
# with:
167+
# library-name: "ansys-dita-ast"
168+
# twine-username: "__token__"
169+
# twine-token: ${{ secrets.PYPI_TOKEN }}
170+
171+
- name: "Release to GitHub"
172+
uses: pyansys/actions/release-github@v4
173+
with:
174+
library-name: ${{ env.PACKAGE_NAME }}
175+

.github/workflows/label.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Labeler
2+
on:
3+
pull_request:
4+
types: [opened, reopened]
5+
push:
6+
branches: [ main ]
7+
paths:
8+
- '../labels.yml'
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
16+
label-syncer:
17+
name: Syncer
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: micnncim/action-label-syncer@v1
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
25+
labeler:
26+
name: Set labels
27+
needs: [label-syncer]
28+
permissions:
29+
contents: read
30+
pull-requests: write
31+
runs-on: ubuntu-latest
32+
steps:
33+
34+
# Label based on modified files
35+
- name: Label based on changed files
36+
uses: actions/labeler@v4
37+
with:
38+
repo-token: ${{ secrets.GITHUB_TOKEN }}
39+
sync-labels: ''
40+
41+
# Label based on branch name
42+
- uses: actions-ecosystem/action-add-labels@v1
43+
if: |
44+
startsWith(github.event.pull_request.head.ref, 'doc') ||
45+
startsWith(github.event.pull_request.head.ref, 'docs')
46+
with:
47+
labels: documentation
48+
49+
- uses: actions-ecosystem/action-add-labels@v1
50+
if: |
51+
startsWith(github.event.pull_request.head.ref, 'maint') ||
52+
startsWith(github.event.pull_request.head.ref, 'no-ci') ||
53+
startsWith(github.event.pull_request.head.ref, 'ci')
54+
with:
55+
labels: maintenance
56+
57+
- uses: actions-ecosystem/action-add-labels@v1
58+
if: startsWith(github.event.pull_request.head.ref, 'feat')
59+
with:
60+
labels: |
61+
enhancement
62+
63+
- uses: actions-ecosystem/action-add-labels@v1
64+
if: |
65+
startsWith(github.event.pull_request.head.ref, 'fix') ||
66+
startsWith(github.event.pull_request.head.ref, 'patch')
67+
with:
68+
labels: bug
69+
70+
commenter:
71+
runs-on: ubuntu-latest
72+
needs: labeler
73+
steps:
74+
- name: Suggest to add labels
75+
uses: peter-evans/create-or-update-comment@v3
76+
# Execute only when no labels have been applied to the pull request
77+
if: toJSON(github.event.pull_request.labels.*.name) == '{}'
78+
with:
79+
issue-number: ${{ github.event.pull_request.number }}
80+
body: |
81+
Please add one of the following labels to add this contribution to the Release Notes :point_down:
82+
- [bug](https://github.com/pyansys/pydita-ast/pulls?q=label%3Abug+)
83+
- [documentation](https://github.com/pyansys/pydita-ast/pulls?q=label%3Adocumentation+)
84+
- [enhancement](https://github.com/pyansys/pydita-ast/pulls?q=label%3Aenhancement+)
85+
- [good first issue](https://github.com/pyansys/pydita-ast/pulls?q=label%3Agood+first+issue)
86+
- [maintenance](https://github.com/pyansys/pydita-ast/pulls?q=label%3Amaintenance+)
87+
- [release](https://github.com/pyansys/pydita-ast/pulls?q=label%3Arelease+)

.pre-commit-config.yaml

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,40 @@
11
repos:
22

33
- repo: https://github.com/psf/black
4-
rev: 22.3.0
4+
rev: 22.12.0
55
hooks:
66
- id: black
7+
args:
8+
- --line-length=88
9+
10+
- repo: https://github.com/adamchainz/blacken-docs
11+
rev: v1.12.1
12+
hooks:
13+
- id: blacken-docs
14+
additional_dependencies: [black==22.12.0]
15+
args:
16+
- --line-length=88
717

818
- repo: https://github.com/pycqa/isort
9-
rev: 5.10.1
19+
rev: 5.12.0
1020
hooks:
1121
- id: isort
1222

13-
- repo: https://gitlab.com/PyCQA/flake8
14-
rev: 4.0.1
23+
- repo: https://github.com/PyCQA/flake8
24+
rev: 6.0.0
1525
hooks:
1626
- id: flake8
27+
args:
28+
- --max-line-length=88
1729

18-
- repo: https://github.com/codespell-project/codespell
19-
rev: v2.1.0
30+
- repo: https://github.com/pre-commit/pre-commit-hooks
31+
rev: v4.4.0
2032
hooks:
21-
- id: codespell
33+
- id: check-merge-conflict
34+
- id: debug-statements
2235

23-
- repo: https://github.com/pycqa/pydocstyle
24-
rev: 6.1.1
36+
# this validates our github workflow files
37+
- repo: https://github.com/python-jsonschema/check-jsonschema
38+
rev: 0.22.0
2539
hooks:
26-
- id: pydocstyle
27-
additional_dependencies: [toml]
28-
exclude: "tests/"
40+
- id: check-github-workflows

AUTHORS.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Authors
2+
3+
## Project Lead
4+
5+
* [Alex Kaszynski](https://github.com/akaszynski)
6+
7+
8+
## Contributors
9+
10+
* [Camille Latapie](https://github.com/clatapie)
11+
* [Roberto Pastor Muela](https://github.com/RobPasMue)
12+
* [German Martinez Ayuso](https://github.com/germa89)

0 commit comments

Comments
 (0)