diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4f360ac --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,56 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "invectio" +urls = { url = "https://github.com/thoth-station/invectio" } +description = "Statically analyze sources and extract information about called and exported library functions in Python applications" +readme = "README.rst" +authors = [ + { name = "Fridolin Pokorny", email = "fridex.devel@gmail.com" } +] +maintainers = [ + { name = "Fridolin Pokorny", email = "fridex.devel@gmail.com" } +] +license = { text = "GPLv3+" } +classifiers = [ + "Operating System :: POSIX :: Linux", + "Topic :: Software Development", + "Development Status :: 4 - Beta", + "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", + "Intended Audience :: Developers", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9" +] +keywords = [ "ast", "source", "code", "analysis", "thoth", "library" ] +dynamic = [ "version", "dependencies" ] + +[project.scripts] +invectio = "invectio.cli:cli" + +[tool.setuptools] +zip-safe = false + +[tool.setuptools.dynamic] +version = {attr = "invectio.__version__"} +dependencies = { file = ["requirements.txt"] } + +[tool.setuptools.package-data] +invectio = ["py.typed"] + +[tool.setuptools.packages.find] +namespaces = false + +[tool.pytest.ini_options] +pythonpath = ["."] +addopts = "--timeout=60 --cov --mypy --capture=no --verbose --ignore=tests/data/ -l -s -vv" +testpaths = [ + "tests" +] + +[tool.coverage.run] +source = ["invectio"] diff --git a/setup.py b/setup.py deleted file mode 100644 index 9ef58d9..0000000 --- a/setup.py +++ /dev/null @@ -1,90 +0,0 @@ -"""Setup for python module.""" - -import sys -import os -from pathlib import Path -from setuptools import setup -from setuptools import find_packages -from setuptools.command.test import test as test_command - -HERE = os.path.dirname(os.path.realpath(__file__)) - - -class Test(test_command): - """Introduce test command to run testsuite using pytest.""" - - user_options = [("pytest-args=", "a", "Arguments to pass into py.test")] - - def initialize_options(self): - """Initialize options.""" - super().initialize_options() - self.pytest_args = [ - "tests/", - "--timeout=60", - "--cov=./invectio", - "--mypy", - "--capture=no", - "--verbose", - "--ignore=tests/data/", - "-l", - "-s", - "-vv", - ] - - def finalize_options(self): - """Finalize options.""" - super().finalize_options() - self.test_args = [] - self.test_suite = True - - def run_tests(self): - """Run tests.""" - import pytest - - sys.exit(pytest.main(self.pytest_args)) - - -def get_version(): - """Get version.""" - with open(os.path.join("invectio", "__init__.py")) as f: - content = f.readlines() - - for line in content: - if line.startswith("__version__ ="): - # dirty, remove trailing and leading chars - return line.split(" = ")[1][1:-2] - raise ValueError("No version identifier found") - - -setup( - name="invectio", - url="https://github.com/thoth-station/invectio", - description="Statically analyze sources and extract information about called and exported library functions in Python applications", - long_description=(Path(HERE) / "README.rst").read_text(), - author="Fridolin Pokorny", - author_email="fridex.devel@gmail.com", - maintainer="Fridolin Pokorny", - maintainer_email="fridex.devel@gmail.com", - license="GPLv3+", - package_data={ - "invectio": ["py.typed"], - }, - classifiers=[ - "Operating System :: POSIX :: Linux", - "Topic :: Software Development", - "Development Status :: 4 - Beta", - "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", - "Intended Audience :: Developers", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - ], - keywords="ast source code analysis thoth library", - packages=find_packages(), - entry_points={"console_scripts": ["invectio=invectio.cli:cli"]}, - install_requires=(Path(HERE) / "requirements.txt").read_text(), - cmdclass={"test": Test}, - version=get_version(), -)