Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils-sfg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
pystencils-sfg
Commits
ff6758e7
Commit
ff6758e7
authored
4 months ago
by
Frederik Hennig
Browse files
Options
Downloads
Patches
Plain Diff
update contributing
parent
9b5731e3
No related branches found
No related tags found
1 merge request
!10
Introduce Nox for Test Automation
Pipeline
#71687
passed
4 months ago
Stage: Code Quality
Stage: Tests
Stage: Documentation
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CONTRIBUTING.md
+29
-7
29 additions, 7 deletions
CONTRIBUTING.md
noxfile.py
+1
-1
1 addition, 1 deletion
noxfile.py
with
30 additions
and
8 deletions
CONTRIBUTING.md
+
29
−
7
View file @
ff6758e7
...
...
@@ -13,6 +13,19 @@ As such, any submission of contributions via merge requests is considered as agr
## Developing `pystencils-sfg`
### Prequesites
To develop pystencils-sfg, you will need at least these packages:
-
Python 3.10
-
Git
-
A C++ compiler supporting at least C++20 (gcc >= 10, or clang >= 10)
-
GNU Make
-
CMake
-
Nox
Before continuing, make sure that the above packages are installed on your machine.
### Fork and Clone
To work within the
`pystencils-sfg`
source tree, first create a
*fork*
of this repository
...
...
@@ -29,28 +42,29 @@ source .venv/bin/activate
pip
install
-e
.
```
If you have
[
nox
](
https://nox.thea.codes/en/stable/
)
installed, you can also set up your virtual environment
by running
`nox --session dev_env`
.
### Code Style and Type Checking
To contribute, please adhere to the Python code style set by
[
PEP 8
](
https://peps.python.org/pep-0008/
)
.
For consistency, format all your source files using the
[
black
](
https://pypi.org/project/black/
)
formatter
.
Us
e flake8
to check your code style
:
For consistency, format all your source files using the
[
black
](
https://pypi.org/project/black/
)
formatter
,
and check them regularily using th
e
`
flake8
`
linter through Nox
:
```
shell
flake8 src/pystencilssfg
nox
--session
lint
```
Further,
`pystencils-sfg`
is being fully type-checked using
[
MyPy
](
https://www.mypy-lang.org/
)
.
All submitted code should contain type annotations (
[
PEP 484
](
https://peps.python.org/pep-0484/
)
) and must be
correctly statically typed.
Before each commit, check your types by call
ing
Regularily check your code for type errors us
ing
```
shell
mypy src/pystencilssfg
nox
--session
typecheck
```
Both
`flake8`
and
`mypy`
are also run in the integration pipeline.
You can automate the code quality checks by running them via a git pre-commit hook.
Such a hook can be installed using the
[
`install_git_hooks.sh`
](
install_git_hooks.sh
)
script located at the project root.
### Test Your Code
...
...
@@ -65,3 +79,11 @@ In [tests/generator_scripts](tests/generator_scripts), a framework is provided t
for successful execution, correctness, and compilability of their output.
Read the documentation within
[
test_generator_scripts.py
](
tests/generator_scripts/test_generator_scripts.py
)
for more information.
Run the test suite by calling it through Nox:
```
shell
nox
--session
testsuite
```
This will also collect coverage information and produce a coverage report as a HTML site placed in the
`htmlcov`
folder.
This diff is collapsed.
Click to expand it.
noxfile.py
+
1
−
1
View file @
ff6758e7
...
...
@@ -74,7 +74,7 @@ def docs(session: nox.Session):
@nox.session
()
def
dev
(
session
:
nox
.
Session
):
def
dev
_env
(
session
:
nox
.
Session
):
"""
Set up the development environment at .venv
"""
session
.
install
(
"
virtualenv
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment