Update \setup.py to use setup.cfg

This commit is contained in:
Layla 2023-06-30 17:55:38 -04:00
parent 1ff0cc923b
commit c6191c3505
2 changed files with 44 additions and 47 deletions

39
setup.cfg Normal file
View File

@ -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

View File

@ -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"))