From c5cd8545909ecb33baa6a3d4937db691f407bf53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=20Bosch?= Date: Fri, 8 Sep 2023 10:42:50 +0200 Subject: [PATCH] feat: switch to setuptools to install local package --- cookiecutter.json | 1 + {{ cookiecutter.repo_name }}/pyproject.toml | 39 +++++++++++++-------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/cookiecutter.json b/cookiecutter.json index 24bcc02..511ea14 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -5,5 +5,6 @@ "python_version": "3.10", "author_name": "Martí Bosch", "github_username": "martibosch", + "email": "marti.bosch@epfl.ch", "description": "A short description of the project." } diff --git a/{{ cookiecutter.repo_name }}/pyproject.toml b/{{ cookiecutter.repo_name }}/pyproject.toml index 16e6a59..8253ff4 100644 --- a/{{ cookiecutter.repo_name }}/pyproject.toml +++ b/{{ cookiecutter.repo_name }}/pyproject.toml @@ -1,6 +1,29 @@ [build-system] -requires = ["poetry-core>=1.0.0"] -build-backend = "poetry.core.masonry.api" +requires = ["setuptools>=61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "{{ cookiecutter.repo_name }}" +version = "0.1.0" +description = "{{ cookiecutter.description }}" +authors = [{ name = "{{ cookiecutter.author_name }}", email = "{{ cookiecutter.email }}" }] +readme = "README.md" +license = { text = "GPL-3.0-only" } +classifiers = [ + "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", +] +requires-python = ">=3.8" + +[project.urls] +Repository = "https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.repo_name }}" + +[tool.setuptools.packages.find] +include = ["{{ cookiecutter.python_module_name }}", "{{ cookiecutter.python_module_name }}.*"] [tool.black] line-length = 88 @@ -15,15 +38,3 @@ known-first-party = ["{{ cookiecutter.python_module_name }}"] [tool.nbqa.addopts] # ignore documentation errors in notebooks ruff = ["--ignore=D"] - -[tool.poetry] -name = "{{ cookiecutter.repo_name }}" -version = "0.1.0" -description = "{{ cookiecutter.description }}" -license = "GPL-3.0" -authors = [ - "{{ cookiecutter.author_name }}", -] -packages = [ - { include = "{{ cookiecutter.python_module_name }}" }, -]