Skip to content
Snippets Groups Projects
Verified Commit 29ece1af authored by Tamas Gal's avatar Tamas Gal :speech_balloon:
Browse files

Restructure and modernise

parent 23149565
Branches
No related tags found
No related merge requests found
Pipeline #26276 failed
Showing
with 108 additions and 71 deletions
...@@ -2,11 +2,8 @@ ...@@ -2,11 +2,8 @@
source = {{cookiecutter.project_slug}} source = {{cookiecutter.project_slug}}
[report] [report]
include =
{{cookiecutter.project_slug}}/*
omit = omit =
tests/* src/{{cookiecutter.project_slug}}/version.py
{{cookiecutter.project_slug}}/version.py
exclude_lines = exclude_lines =
pragma: no cover pragma: no cover
raise AssertionError raise AssertionError
......
...@@ -4,7 +4,7 @@ __pycache__/ ...@@ -4,7 +4,7 @@ __pycache__/
*.pyxbldc *.pyxbldc
# Version info # Version info
{{cookiecutter.project_slug}}/version.py src/{{cookiecutter.project_slug}}/version.py
# Build stuff # Build stuff
build/ build/
......
PKGNAME={{cookiecutter.project_slug}}
install: install:
pip install . pip install .
...@@ -10,10 +8,10 @@ clean: ...@@ -10,10 +8,10 @@ clean:
python setup.py clean --all python setup.py clean --all
test: test:
py.test --junitxml=./reports/junit.xml -o junit_suite_name=$(PKGNAME) tests py.test --junitxml=./reports/junit.xml -o junit_suite_name={{cookiecutter.project_slug}} tests
test-cov: test-cov:
py.test --cov ./$(PKGNAME) --cov-report term-missing --cov-report xml:reports/coverage.xml --cov-report html:reports/coverage tests py.test --cov src/{{cookiecutter.project_slug}} --cov-report term-missing --cov-report xml:reports/coverage.xml --cov-report html:reports/coverage tests
test-loop: test-loop:
py.test tests py.test tests
...@@ -30,11 +28,9 @@ docstyle: ...@@ -30,11 +28,9 @@ docstyle:
lint: lint:
py.test --pylint py.test --pylint
dependencies:
pip install -Ur requirements.txt
.PHONY: black .PHONY: black
black: black:
black --exclude 'version.py' src/{{cookiecutter.project_slug}}
black examples black examples
black tests black tests
black doc/conf.py black doc/conf.py
...@@ -42,10 +38,11 @@ black: ...@@ -42,10 +38,11 @@ black:
.PHONY: black-check .PHONY: black-check
black-check: black-check:
black --check --exclude 'version.py' src/{{cookiecutter.project_slug}}
black --check examples black --check examples
black --check tests black --check tests
black --check doc/conf.py black --check doc/conf.py
black --check setup.py black --check setup.py
.PHONY: all clean install install-dev test test-nocov flake8 pep8 dependencies docstyle black black-check .PHONY: all clean install install-dev test test-nocov flake8 pep8 docstyle black black-check
...@@ -48,7 +48,7 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'version.py'] ...@@ -48,7 +48,7 @@ exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'version.py']
# AutoAPI # AutoAPI
autoapi_type = "python" autoapi_type = "python"
autoapi_dirs = ['../{{cookiecutter.project_slug}}'] autoapi_dirs = ['../src/{{cookiecutter.project_slug}}']
autoapi_options = ["members", "undoc-members", "show-module-summary"] autoapi_options = ["members", "undoc-members", "show-module-summary"]
autoapi_include_summaries = True autoapi_include_summaries = True
......
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
[tool.setuptools_scm] [tool.setuptools_scm]
write_to = "{{cookiecutter.project_slug}}/version.py" write_to = "src/{{cookiecutter.project_slug}}/version.py"
black
matplotlib
numpydoc
pillow
pytest
pytest-cov
pytest-flake8
pytest-pylint
pytest-watch
sphinx
sphinx-autoapi
sphinx-gallery>=0.1.12
sphinx_rtd_theme
sphinxcontrib-versioning
wheel
setuptools_scm
[metadata]
name = {{cookiecutter.project_slug}}
description = {{cookiecutter.description}}
long_description = file: README.rst
long_description_content_type = text/x-rst
url = {{cookiecutter.gitlab_repo_path}}
author = {{cookiecutter.author}}
author_email = {{cookiecutter.email}}
maintainer = {{cookiecutter.author}}
maintainer_email = {{cookiecutter.email}}
license = MIT
license_file = LICENSE
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Intended Audience :: Science/Research
License :: OSI Approved :: BSD License
Operating System :: OS Independent
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Topic :: Scientific/Engineering
keywords =
neutrino
astroparticle
physics
HEP
[options]
packages = find:
install_requires =
setuptools_scm
python_requires = >=3.6
include_package_data = True
package_dir =
=src
[options.packages.find]
where = src
[options.extras_require]
all =
black
matplotlib
numpydoc
pillow
pytest
pytest-cov
pytest-flake8
pytest-pylint
pytest-watch
sphinx
sphinx-autoapi
sphinx-gallery>=0.1.12
sphinx_rtd_theme
sphinxcontrib-versioning
wheel
dev =
black
matplotlib
numpydoc
pillow
pytest
pytest-cov
pytest-flake8
pytest-pylint
pytest-watch
sphinx
sphinx-autoapi
sphinx-gallery>=0.1.12
sphinx_rtd_theme
sphinxcontrib-versioning
wheel
[options.package_data]
* = *.py.typed
[bdist_wheel]
universal = 1
[tool:pytest]
junit_family = xunit2
addopts = -vv -rs -Wd
testpaths =
tests
[check-manifest]
ignore =
src/{{cookiecutter.project_slug}}/version.py
[tool:isort]
profile = black
multi_line_output = 3
#!/usr/bin/env python #!/usr/bin/env python
# Filename: setup.py
"""
The {{cookiecutter.project_slug}} setup script.
"""
from setuptools import setup from setuptools import setup
import os
def read_requirements(kind):
"""Return a list of stripped lines from a file"""
with open(os.path.join("requirements", kind + ".txt")) as fobj:
return [l.strip() for l in fobj.readlines()]
try:
with open("README.rst") as fh:
long_description = fh.read()
except UnicodeDecodeError:
long_description = "{{cookiecutter.description}}"
setup( setup()
name='{{cookiecutter.project_slug}}',
url='{{cookiecutter.gitlab_repo_path}}',
description='{{cookiecutter.description}}',
long_description=long_description,
author='{{cookiecutter.author}}',
author_email='{{cookiecutter.email}}',
packages=['{{cookiecutter.project_slug}}'],
include_package_data=True,
platforms='any',
setup_requires=['setuptools_scm'],
use_scm_version=True,
python_requires='>=3.6',
install_requires=read_requirements("install"),
extras_require={kind: read_requirements(kind) for kind in ["dev"]},
classifiers=[
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Programming Language :: Python',
],
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment