From 070432d4c6fceaaed833a6cc895962c6eb7865d5 Mon Sep 17 00:00:00 2001 From: Marcel Arpogaus <38564291+MArpogaus@users.noreply.github.com> Date: Fri, 13 Sep 2024 18:55:24 +0200 Subject: [PATCH] build: update pyproject.toml to use setuptools_scm for versioning --- pyproject.toml | 52 +++++++++++++++++++++++---------------- setup.py | 36 --------------------------- src/dvc_stage/__init__.py | 3 +-- 3 files changed, 32 insertions(+), 59 deletions(-) delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index 8607efa..fcf3e1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,14 @@ [build-system] build-backend = "setuptools.build_meta" -requires = ["setuptools >= 61.0.0"] +requires = ["setuptools >= 61", "setuptools_scm>=7"] [project] classifiers = [ "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", - "OSI Approved :: GNU General Public License v3 (GPLv3)" + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11" ] dependencies = [ "dvc >= 2.12", @@ -23,32 +24,41 @@ requires-python = ">=3.7" [project.optional-dependencies] develop = [ - 'autoflake', - 'black', - 'isort', + 'commitizen', + 'ipykernel', 'pre-commit', - 'pytest', - 'python-lsp-black', + 'pylsp-rope', + 'python-lsp-ruff', 'python-lsp-server[all]', - 'ipykernel', - 'tox' + 'ruff' ] [project.scripts] dvc-stage = "dvc_stage.cli:cli" -[tool.autoflake] -expand-star-imports = true -ignore-init-module-imports = true -remove-all-unused-imports = true -remove-unused-variables = true +[project.urls] +Changelog = "https://github.com/MArpogaus/dvc-stage/blob/dev/CHANGELOG.md" +Documentation = "https://marpogaus.github.io/dvc-stage" +Issues = "https://github.com/MArpogaus/dvc-stage/issues" +Repository = "https://github.com/MArpogaus/dvc-stage" + +[tool.commitizen] +major_version_zero = true +name = "cz_conventional_commits" +tag_format = "v$version" +update_changelog_on_bump = true +version_provider = "scm" +version_scheme = "pep440" -[tool.black] -# line-length = 88 -target-version = ['py38'] +[tool.ruff] +indent-width = 4 +line-length = 88 +target-version = "py37" -[tool.isort] -profile = "black" +[tool.ruff.lint] +select = ["I", "E", "F"] -[tool.setuptools.dynamic] -version = {attr = "dvc_stage.__version__"} +[tool.setuptools_scm] +# https://stackoverflow.com/a/74404703 +# omits local version, useful because pypi does not support it +local_scheme = "no-local-version" diff --git a/setup.py b/setup.py deleted file mode 100644 index 3457bde..0000000 --- a/setup.py +++ /dev/null @@ -1,36 +0,0 @@ -# AUTHOR INFORMATION ########################################################## -# file : setup.py -# brief : [Description] -# -# author : Marcel Arpogaus -# date : 2020-03-23 17:32:10 -# COPYRIGHT ################################################################### -# Copyright 2020 Marcel Arpogaus -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# NOTES ###################################################################### -# -# This project is following the -# [PEP8 style guide](https://www.python.org/dev/peps/pep-0008/) -# -# This file is only provided for legacy compatibility: -# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html -# -# All Metadata is specified in pyproject.toml -# -############################################################################### -# REQUIRED PYTHON MODULES ##################################################### -"""module dvc stage.""" -from setuptools import setup - -setup() diff --git a/src/dvc_stage/__init__.py b/src/dvc_stage/__init__.py index 652d0d3..7c19b9d 100644 --- a/src/dvc_stage/__init__.py +++ b/src/dvc_stage/__init__.py @@ -1,2 +1 @@ -"""dvc-stage module.""" -__version__ = "1.0.0-dev" +""".. include:: ../../README.md"""