Skip to content

Commit

Permalink
bump version, merge pull request #2 from NiftyPET/devel
Browse files Browse the repository at this point in the history
  • Loading branch information
casperdcl authored Dec 6, 2020
2 parents 12628e1 + 08e22b7 commit bc14552
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ jobs:
- id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ninst ${{ github.ref }} beta
body_path: _CHANGES.md
draft: true
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.collect_assets.outputs.asset_path }}
Expand Down
18 changes: 11 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
==================================
ninst: NiftyPET Installation Tools
NINST: NiftyPET Installation Tools
==================================

|Docs| |PyPI-Status|
|Docs| |Version| |Py-Versions| |Tests| |Coverage|

``ninst`` is a stand-alone Python sub-package of NiftyPET_, dedicated to helping with installation of other sub-packages. Although it is an essential part of NiftyPET_ packaging, ``ninst`` could be used in other projects.

Expand All @@ -23,9 +23,13 @@ Copyright 2018-20

.. |Docs| image:: https://readthedocs.org/projects/niftypet/badge/?version=latest
:target: https://niftypet.readthedocs.io/en/latest/?badge=latest
.. |Licence| image:: https://img.shields.io/pypi/l/ninst.svg?label=licence
:target: https://github.com/NiftyPET/ninst/blob/master/LICENCE
.. |PyPI-Downloads| image:: https://img.shields.io/pypi/dm/ninst.svg?label=PyPI%20downloads
:target: https://pypi.org/project/ninst
.. |PyPI-Status| image:: https://img.shields.io/pypi/v/ninst.svg?label=latest
.. |Licence| image:: https://img.shields.io/pypi/l/ninst.svg
:target: https://raw.githubusercontent.com/NiftyPET/ninst/master/LICENCE
.. |Tests| image:: https://img.shields.io/github/workflow/status/NiftyPET/ninst/Test?logo=GitHub
:target: https://github.com/NiftyPET/ninst/actions
.. |Coverage| image:: https://codecov.io/gh/NiftyPET/ninst/branch/master/graph/badge.svg
:target: https://codecov.io/gh/NiftyPET/ninst
.. |Version| image:: https://img.shields.io/pypi/v/ninst.svg?logo=python&logoColor=white
:target: https://github.com/NiftyPET/ninst/releases
.. |Py-Versions| image:: https://img.shields.io/pypi/pyversions/ninst.svg?logo=python&logoColor=white
:target: https://pypi.org/project/ninst
8 changes: 4 additions & 4 deletions niftypet/ninst/cudasetup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/env python
"""Tools for CUDA compilation and set-up for Python 3."""
import importlib
import logging
import os

# from pkg_resources import resource_filename
import platform
import re
import shutil
import sys
from distutils.sysconfig import get_python_inc
from textwrap import dedent

# from pkg_resources import resource_filename
try:
from numpy import get_include as get_numpy_inc
except ImportError:
Expand Down Expand Up @@ -168,7 +168,7 @@ def resources_setup(gpu=True):
return dev_setup() if gpu else ""


def get_resources(sys_append=True):
def get_resources(sys_append=True, reload=True):
path_resources = path_niftypet_local()
if sys_append:
if path_resources not in sys.path:
Expand All @@ -189,4 +189,4 @@ def get_resources(sys_append=True):
)
raise
else:
return resources
return importlib.reload(resources) if reload else resources
19 changes: 11 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ classifiers=
Programming Language :: C
Programming Language :: C++
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3 :: Only
Topic :: Scientific/Engineering :: Medical Science Apps.
Topic :: Software Development :: Libraries
Expand All @@ -33,7 +36,7 @@ install_requires=tqdm; miutil[cuda]>=0.4.2
packages=find:
python_requires=>=3.6
[options.extras_require]
dev =
dev=
pre-commit
twine
wheel
Expand All @@ -43,16 +46,16 @@ dev =
pytest-xdist
codecov
[options.package_data]
* = *.md, *.rst
*=*.md, *.rst

[flake8]
max_line_length = 88
extend-ignore = E203,P1
exclude = .git,__pycache__,build,dist,.eggs
max_line_length=88
extend-ignore=E203,P1
exclude=.git,__pycache__,build,dist,.eggs

[isort]
profile = black
known_first_party = niftypet,tests
profile=black
known_first_party=niftypet,tests

[coverage:paths]
rsrc=
Expand All @@ -62,4 +65,4 @@ rsrc=
c:\*\.niftypet

[tool:pytest]
addopts=-v --cov=niftypet --cov-report=term-missing --cov-report=xml
addopts=-v -rxs --cov=niftypet --cov-report=term-missing --cov-report=xml
8 changes: 8 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import os

import pytest


@pytest.fixture(scope="session", autouse=True)
def noninteractive():
if os.getenv("DISPLAY", False):
pytest.skip("Need to call pytest with DISPLAY=''")


@pytest.fixture(scope="session")
def nvml():
import pynvml
Expand Down

0 comments on commit bc14552

Please sign in to comment.