Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
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
Model registry
Operate
Environments
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
Commits
65a865b7
Commit
65a865b7
authored
4 months ago
by
Frederik Hennig
Browse files
Options
Downloads
Patches
Plain Diff
Install cupy in docs session
parent
23272e17
No related branches found
No related tags found
1 merge request
!436
Introduce Nox for Local and CI Test Automation. Start Writing a Contributors Guide.
Pipeline
#71902
failed
4 months ago
Stage: Code Quality
Stage: Unit Tests
Stage: legacy_test
Stage: docs
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
noxfile.py
+33
-22
33 additions, 22 deletions
noxfile.py
pytest.ini
+2
-0
2 additions, 0 deletions
pytest.ini
with
35 additions
and
22 deletions
noxfile.py
+
33
−
22
View file @
65a865b7
...
...
@@ -9,9 +9,9 @@ import re
nox
.
options
.
sessions
=
[
"
lint
"
,
"
typecheck
"
,
"
testsuite
"
]
def
get_cuda_version
()
->
None
|
tuple
[
int
,
...]:
def
get_cuda_version
(
session
:
nox
.
Session
)
->
None
|
tuple
[
int
,
...]:
query_args
=
[
"
nvcc
"
,
"
--version
"
]
try
:
query_result
=
subprocess
.
run
(
query_args
,
capture_output
=
True
)
except
FileNotFoundError
:
...
...
@@ -21,9 +21,34 @@ def get_cuda_version() -> None | tuple[int, ...]:
if
matches
:
match
=
matches
[
0
]
version_string
=
match
.
split
()[
-
1
]
return
tuple
(
int
(
v
)
for
v
in
version_string
.
split
(
"
.
"
))
else
:
return
None
try
:
return
tuple
(
int
(
v
)
for
v
in
version_string
.
split
(
"
.
"
))
except
ValueError
:
pass
session
.
warn
(
"
nvcc was found, but I am unable to determine the CUDA version.
"
)
return
None
def
install_cupy
(
session
:
nox
.
Session
,
cupy_version
:
str
,
skip_if_no_cuda
:
bool
=
False
):
if
cupy_version
is
not
None
:
cuda_version
=
get_cuda_version
(
session
)
if
cuda_version
is
None
or
cuda_version
[
0
]
not
in
(
11
,
12
):
if
skip_if_no_cuda
:
session
.
skip
(
"
No compatible installation of CUDA found - Need either CUDA 11 or 12
"
)
else
:
session
.
warn
(
"
Running without cupy: no compatbile installation of CUDA found. Need either CUDA 11 or 12.
"
)
return
cuda_major
=
cuda_version
[
0
]
cupy_package
=
f
"
cupy-cuda
{
cuda_major
}
x==
{
cupy_version
}
"
session
.
install
(
cupy_package
)
def
editable_install
(
session
:
nox
.
Session
,
opts
:
Sequence
[
str
]
=
()):
...
...
@@ -54,15 +79,7 @@ def typecheck(session: nox.Session):
@nox.session
(
python
=
"
3.10
"
,
tags
=
[
"
test
"
])
def
testsuite
(
session
:
nox
.
Session
,
cupy_version
:
str
|
None
):
if
cupy_version
is
not
None
:
cuda_version
=
get_cuda_version
()
if
cuda_version
is
None
or
cuda_version
[
0
]
not
in
(
11
,
12
):
session
.
skip
(
"
No compatible installation of CUDA found - Need either CUDA 11 or 12
"
)
cuda_major
=
cuda_version
[
0
]
cupy_package
=
f
"
cupy-cuda
{
cuda_major
}
x==
{
cupy_version
}
"
session
.
install
(
cupy_package
)
install_cupy
(
session
,
cupy_version
,
skip_if_no_cuda
=
True
)
editable_install
(
session
,
[
"
alltrafos
"
,
"
use_cython
"
,
"
interactive
"
,
"
testsuite
"
])
...
...
@@ -88,13 +105,7 @@ def testsuite(session: nox.Session, cupy_version: str | None):
@nox.session
(
python
=
[
"
3.10
"
],
tags
=
[
"
docs
"
])
def
docs
(
session
:
nox
.
Session
):
"""
Build the documentation pages
"""
install_cupy
(
session
,
"
12.3
"
)
editable_install
(
session
,
[
"
doc
"
])
session
.
chdir
(
"
docs
"
)
session
.
run
(
"
make
"
,
"
html
"
,
external
=
True
,
env
=
{
"
SPHINXOPTS
"
:
"
-W --keep-going
"
}
)
session
.
run
(
"
make
"
,
"
html
"
,
external
=
True
,
env
=
{
"
SPHINXOPTS
"
:
"
-W --keep-going
"
})
This diff is collapsed.
Click to expand it.
pytest.ini
+
2
−
0
View file @
65a865b7
...
...
@@ -23,6 +23,7 @@ filterwarnings =
ignore:Using
or
importing
the
ABCs
from
'collections'
instead
of
from
'collections.abc':DeprecationWarning
ignore:Animation
was
deleted
without
rendering
anything:UserWarning
# Coverage Configuration
[run]
branch
=
True
source
=
src/pystencils
...
...
@@ -31,6 +32,7 @@ source = src/pystencils
omit
=
doc/*
tests/*
setup.py
noxfile.py
quicktest.py
conftest.py
versioneer.py
...
...
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