diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 98a745db82cb616179dc9966c7c64e569640080c..9e3025ab729e7b0baff30783d85090f875750f23 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,24 +17,32 @@ install-py3.9: stage: install script: - make install + cache: + key: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME" install-py3.12: image: git.km3net.de:4567/common/dockerfiles/base/python:3.12 stage: install script: - make install + cache: + key: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME" install-dev-py3.9: image: docker.km3net.de/base/python:3.9 stage: install-dev script: - make install-dev + cache: + key: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME" install-dev-py3.12: image: git.km3net.de:4567/common/dockerfiles/base/python:3.12 stage: install-dev script: - make install-dev + cache: + key: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME" test-py3.9: image: docker.km3net.de/base/python:3.9 @@ -42,6 +50,8 @@ test-py3.9: script: - make install-dev - make test + cache: + key: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME" test-py3.12: image: git.km3net.de:4567/common/dockerfiles/base/python:3.12 @@ -49,17 +59,13 @@ test-py3.12: script: - make install-dev - make test + cache: + key: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME" -doc-py3.9: - image: docker.km3net.de/base/python:3.9 - stage: doc - script: - - make install-dev - - cd doc && make html - -doc-py3.12: +doc: image: git.km3net.de:4567/common/dockerfiles/base/python:3.12 stage: doc script: - make install-dev - cd doc && make html + cache: {} diff --git a/{{cookiecutter.project_slug}}/.gitlab-ci.yml b/{{cookiecutter.project_slug}}/.gitlab-ci.yml index 4df143e621a4c6534ff96e9902b316dc466e16c4..ab18cbe6a49d841dae61cca407c3532c445bcfd5 100644 --- a/{{cookiecutter.project_slug}}/.gitlab-ci.yml +++ b/{{cookiecutter.project_slug}}/.gitlab-ci.yml @@ -19,7 +19,7 @@ stages: python -V python3 -m venv venv source venv/bin/activate - pip install -U pip setuptools wheel setuptools_scm + pip install -U pip setuptools wheel setuptools_scm packaging hash -r pip freeze make install-dev @@ -30,22 +30,6 @@ stages: reports: junit: "reports/junit*.xml" -test-py3.6: - image: docker.km3net.de/base/python:3.6 - stage: test - script: - - *virtualenv_definition - - make test - <<: *junit_definition - -test-py3.7: - image: docker.km3net.de/base/python:3.7 - stage: test - script: - - *virtualenv_definition - - make test - <<: *junit_definition - test-py3.8: image: docker.km3net.de/base/python:3.8 stage: test @@ -137,9 +121,9 @@ pypi: stage: release cache: {} script: - - pip install -U twine wheel setuptools_scm - - python setup.py sdist - - python setup.py bdist_wheel + - pip install -U twine wheel setuptools_scm build + - python -m build --sdist + - python -m build --wheel - twine upload dist/* only: - tags diff --git a/{{cookiecutter.project_slug}}/pyproject.toml b/{{cookiecutter.project_slug}}/pyproject.toml index 36dec2d6caaa384c58df7ff1a684f2edd72925fe..f2a13bf28f294a41e6f27353f264d8eeb7f0a10e 100644 --- a/{{cookiecutter.project_slug}}/pyproject.toml +++ b/{{cookiecutter.project_slug}}/pyproject.toml @@ -1,5 +1,63 @@ +[project] +name = "{{cookiecutter.project_slug}}" +description = "{{cookiecutter.description}}" +readme = {file = "README.rst", content-type = "text/x-rst"} +license = MIT +dynamic = ["version"] +authors = [ + {name = "{{cookiecutter.author}}", email ="{{cookiecutter.email}}"} +] +maintainers = [ + {name = "{{cookiecutter.author}}", email ="{{cookiecutter.email}}"} +] +requires-python = ">=3.8" +dependencies = [ +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Scientific/Engineering" +] + [build-system] requires = ["setuptools>=42", "wheel", "setuptools_scm[toml]>=3.4"] [tool.setuptools_scm] write_to = "src/{{cookiecutter.project_slug}}/version.py" + +[project.urls] +Homepage = "{{cookiecutter.gitlab_repo_url}}" +Documentation = "{{cookiecutter.gitlab_pages_url}}" +Repository = "{{cookiecutter.gitlab_repo_url}}" +Issues = "{{cookiecutter.gitlab_repo_url}}/-/issues" +Changelog = "{{cookiecutter.gitlab_pages_url}}/changelog.html" + +[project.optional-dependencies] +dev = [ + "black", + "km3net_testdata>=0.2.7", + "matplotlib", + "memory_profiler", + "mock", + "numpydoc", + "pytest", + "pytest-cov", + "pytest-watch", + "sphinx", + "sphinx-autoapi", + "sphinx-gallery>=0.1.12", + "sphinx_rtd_theme", + "sphinxcontrib-versioning", + "wheel" +] diff --git a/{{cookiecutter.project_slug}}/setup.py b/{{cookiecutter.project_slug}}/setup.py deleted file mode 100644 index c276fcd2274c5e27a040208c2878cec556d7c8b9..0000000000000000000000000000000000000000 --- a/{{cookiecutter.project_slug}}/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python -from setuptools import setup - -import setuptools_scm - -setup()