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
eaca9d7b
Commit
eaca9d7b
authored
4 months ago
by
Frederik Hennig
Browse files
Options
Downloads
Patches
Plain Diff
add noxfile; update dependencies in pyproject.toml
parent
c70a1c03
No related branches found
No related tags found
1 merge request
!10
Introduce Nox for Test Automation
Pipeline
#71545
failed
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
noxfile.py
+90
-0
90 additions, 0 deletions
noxfile.py
pyproject.toml
+9
-4
9 additions, 4 deletions
pyproject.toml
with
99 additions
and
4 deletions
noxfile.py
0 → 100644
+
90
−
0
View file @
eaca9d7b
from
typing
import
Sequence
import
nox
nox
.
options
.
sessions
=
[
"
lint
"
,
"
typecheck
"
,
"
testsuite
"
,
"
report_coverage
"
]
def
add_pystencils_git
(
session
:
nox
.
Session
):
"""
Clone the pystencils 2.0 development branch and install it in the current session
"""
cache_dir
=
session
.
cache_dir
pystencils_dir
=
cache_dir
/
"
pystencils
"
if
not
pystencils_dir
.
exists
():
session
.
run_install
(
"
git
"
,
"
clone
"
,
"
--branch
"
,
"
v2.0-dev
"
,
"
--single-branch
"
,
"
git@i10git.cs.fau.de:pycodegen/pystencils.git
"
,
pystencils_dir
,
external
=
True
,
)
session
.
install
(
"
-e
"
,
str
(
pystencils_dir
))
def
editable_install
(
session
:
nox
.
Session
,
opts
:
Sequence
[
str
]
=
()):
add_pystencils_git
(
session
)
if
opts
:
opts_str
=
"
[
"
+
"
,
"
.
join
(
opts
)
+
"
]
"
session
.
install
(
"
-e
"
,
f
"
.
{
opts_str
}
"
)
@nox.session
(
tags
=
[
"
qa
"
,
"
code-quality
"
])
def
lint
(
session
:
nox
.
Session
):
"""
Lint code using flake8
"""
session
.
install
(
"
flake8
"
)
session
.
run
(
"
flake8
"
,
"
src/pystencilssfg
"
)
@nox.session
(
tags
=
[
"
qa
"
,
"
code-quality
"
])
def
typecheck
(
session
:
nox
.
Session
):
"""
Run MyPy for static type checking
"""
editable_install
(
session
)
session
.
install
(
"
mypy
"
)
session
.
run
(
"
mypy
"
,
"
src/pystencilssfg
"
)
@nox.session
(
tags
=
[
"
tests
"
])
def
testsuite
(
session
:
nox
.
Session
):
"""
Run the testsuite and measure coverage.
"""
editable_install
(
session
,
[
"
testsuite
"
])
session
.
run
(
"
pytest
"
,
"
-v
"
,
"
--cov=src/pystencilssfg
"
,
"
--cov-report=term
"
,
"
--cov-config=pyproject.toml
"
,
)
@nox.session
(
tags
=
[
"
report
"
])
def
report_coverage
(
session
:
nox
.
Session
):
"""
Produce HTML and XML coverage reports
"""
session
.
install
(
"
coverage[toml]
"
)
session
.
run
(
"
coverage
"
,
"
html
"
)
session
.
run
(
"
coverage
"
,
"
xml
"
)
@nox.session
(
tags
=
[
"
docs
"
])
def
docs
(
session
:
nox
.
Session
):
"""
Build the documentation pages
"""
editable_install
(
session
,
[
"
docs
"
])
session
.
chdir
(
"
docs
"
)
session
.
run
(
"
make
"
,
"
html
"
,
external
=
True
)
@nox.session
(
default
=
False
)
def
dev
(
session
:
nox
.
Session
):
"""
Set up the development environment at .venv
"""
session
.
install
(
"
virtualenv
"
)
session
.
run
(
"
virtualenv
"
,
"
.venv
"
,
"
--prompt
"
,
"
pystencils-sfg
"
)
session
.
run
(
"
.venv/bin/pip
"
,
"
install
"
,
"
git+https://i10git.cs.fau.de/pycodegen/pystencils.git@v2.0-dev
"
,
external
=
True
,
)
session
.
run
(
"
.venv/bin/pip
"
,
"
install
"
,
"
-e
"
,
"
.[dev]
"
,
external
=
True
)
This diff is collapsed.
Click to expand it.
pyproject.toml
+
9
−
4
View file @
eaca9d7b
...
...
@@ -23,10 +23,15 @@ requires = [
build-backend
=
"setuptools.build_meta"
[project.optional-dependencies]
tests
=
[
"flake8
>
=
6.1
.
0
",
"mypy
>
=
1.7
.
0
",
dev
=
[
"flake8"
,
"mypy"
,
"black"
,
"clang-format"
,
]
testsuite
=
[
"pytest"
,
"pytest-cov"
,
"pyyaml"
,
"requests"
,
"fasteners"
,
...
...
@@ -60,7 +65,7 @@ omit = [
[tool.coverage.report]
exclude_also
=
[
"
\\
.
\\
.
\\
."
,
"
\\
.
\\
.
\\
.
\n
"
,
"if TYPE_CHECKING:"
,
"@(abc
\\
.)?abstractmethod"
,
]
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