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
No related branches found
No related tags found
No related merge requests found
Pipeline #26276 failed
Showing
with 108 additions and 71 deletions
......@@ -2,11 +2,8 @@
source = {{cookiecutter.project_slug}}
[report]
include =
{{cookiecutter.project_slug}}/*
omit =
tests/*
{{cookiecutter.project_slug}}/version.py
src/{{cookiecutter.project_slug}}/version.py
exclude_lines =
pragma: no cover
raise AssertionError
......
......@@ -4,7 +4,7 @@ __pycache__/
*.pyxbldc
# Version info
{{cookiecutter.project_slug}}/version.py
src/{{cookiecutter.project_slug}}/version.py
# Build stuff
build/
......
PKGNAME={{cookiecutter.project_slug}}
install:
pip install .
......@@ -10,10 +8,10 @@ clean:
python setup.py clean --all
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:
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:
py.test tests
......@@ -30,11 +28,9 @@ docstyle:
lint:
py.test --pylint
dependencies:
pip install -Ur requirements.txt
.PHONY: black
black:
black --exclude 'version.py' src/{{cookiecutter.project_slug}}
black examples
black tests
black doc/conf.py
......@@ -42,10 +38,11 @@ black:
.PHONY: black-check
black-check:
black --check --exclude 'version.py' src/{{cookiecutter.project_slug}}
black --check examples
black --check tests
black --check doc/conf.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']
# AutoAPI
autoapi_type = "python"
autoapi_dirs = ['../{{cookiecutter.project_slug}}']
autoapi_dirs = ['../src/{{cookiecutter.project_slug}}']
autoapi_options = ["members", "undoc-members", "show-module-summary"]
autoapi_include_summaries = True
......
......@@ -2,4 +2,4 @@
requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"]
[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
# Filename: setup.py
"""
The {{cookiecutter.project_slug}} setup script.
"""
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(
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',
],
)
setup()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment