From c6191c35051e9b1ca6f4716e20edc16e7183d520 Mon Sep 17 00:00:00 2001 From: Layla Date: Fri, 30 Jun 2023 17:55:38 -0400 Subject: [PATCH] Update \setup.py to use `setup.cfg` --- setup.cfg | 39 +++++++++++++++++++++++++++++++++++++++ setup.py | 52 +++++----------------------------------------------- 2 files changed, 44 insertions(+), 47 deletions(-) create mode 100644 setup.cfg diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..d1e0c79 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,39 @@ +[metadata] +name = semver +author = RightBrain Networks +author_email = cloud@rightbrainnetworks.com +description = Automatic Semantic Versioner +long_description = file: README.md, license.txt +url = https://github.com/RightBrain-Networks/auto-semver + +license = Apache2.0 +keywords = Semantic, Version, Git, Auto-Versioning +classifiers = + Programming Language :: Python :: 3 + License :: OSI Approved :: Apache Software License + + # Development Status + Development Status :: 3 - Alpha + + # Audience + Intended Audience :: Developers + Intended Audience :: System Administrators + Topic :: Software Development :: Build Tools + + +[options] +include_package_data = True +packages = find: +python_requires = >=3.7, <4 + +[options.packages.find] +exclude = + contrib* + docs* + tests* + + +[options.entry_points] +console_scripts = + semver = semver:main + semver_get_version = semver.get_version:main \ No newline at end of file diff --git a/setup.py b/setup.py index d5f5cf6..7233fd2 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,12 @@ import re -from pathlib import Path, StrPath +from pathlib import Path +from typing import List # To use a consistent encoding from codecs import open # Always prefer setuptools over distutils -from setuptools import setup, find_packages +from setuptools import setup here = Path(__file__).resolve().parent @@ -15,7 +16,7 @@ with open(Path(here, "README.md"), encoding="utf-8") as f: long_description = f.read() -def find_version(*file_path: StrPath) -> str: +def find_version(*file_path: List[str]) -> str: """ Searches for the semantic version within the given path :param file_path: Path to the file to search @@ -29,47 +30,4 @@ def find_version(*file_path: StrPath) -> str: return version_match.group(1) -setup( - name="semver", - version=find_version("semver", "__init__.py"), - description="Automatic Semantic Versioner", - long_description=long_description, - url="https://github.com/RightBrain-Networks/auto-semver", - # Author details - author="RightBrain Networks", - author_email="cloud@rightbrainnetworks.com", - # Choose your license - license="Apache2.0", - # ======== # - # Metadata # - # ======== # - # See https://pypi.python.org/pypi?%3Aaction=list_classifiers - classifiers=[ - "License :: OSI Approved :: Apache Software License", - # Development Status - "Development Status :: 3 - Alpha", - # Audience - "Intended Audience :: Developers", - "Intended Audience :: System Administrators", - "Topic :: Software Development :: Build Tools", - # Supported Python Versions - "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", - ], - keywords=["Semantic", "Version", "Git", "Auto-Versioning"], - # ======= # - # Package # - # ======= # - packages=find_packages(exclude=["contrib", "docs", "tests"]), - install_requires=["argparse>=1.4.0"], - package_data={}, - entry_points={ - "console_scripts": [ - "semver = semver:main", - "semver_get_version = semver.get_version:main", - ], - }, -) +setup(version=find_version("semver", "__init__.py"))