From f853f4ba6a2ac87ed7ba914f6f46de1815acab2e Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Sat, 25 Nov 2023 18:38:07 +0100 Subject: [PATCH] Add setuptools configuration files --- setup.cfg | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ setup.py | 31 +++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 setup.cfg create mode 100644 setup.py diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..6f338c0 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,76 @@ +# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c + +# --- Setuptools metadata ---------------------------------------------------- + +[metadata] +name = mini3di +version = attr: mini3di.__version__ +author = Martin Larralde +author_email = martin.larralde@embl.de +url = https://github.com/althonos/mini3di +description = A NumPy port of the foldseek code for encoding structures to 3di. +long_description = file: README.md +long_description_content_type = text/markdown +license = MIT +platform = posix +keywords = bioinformatics, protein, structure, foldseek, 3di +classifier = + Development Status :: 4 - Beta + Intended Audience :: Developers + Intended Audience :: Science/Research + License :: OSI Approved :: MIT License + Operating System :: OS Independent + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: Implementation :: CPython + Programming Language :: Python :: Implementation :: PyPy + Topic :: Scientific/Engineering :: Bio-Informatics + Topic :: Scientific/Engineering :: Medical Science Apps. + Typing :: Typed +project_urls = + Bug Tracker = https://github.com/althonos/mini3di/issues + Changelog = https://github.com/althonos/mini3di/blob/master/CHANGELOG.md + Coverage = https://codecov.io/gh/althonos/mini3di/ + Builds = https://github.com/althonos/mini3di/actions + PyPI = https://pypi.org/project/mini3di + +[options] +zip_safe = true +packages = mini3di +python_requires = >=3.7 +test_suite = tests +include_package_data = true +setup_requires = setuptools >=46.4 + +[options.package_data] +mini3di = py.typed, *.kerasify + +[bdist_wheel] +universal = true + +# --- Python tools configuration --------------------------------------------- + +[coverage:report] +include = mini3di/*.py +show_missing = true +exclude_lines = + pragma: no cover + if typing.TYPE_CHECKING: + @abc.abstractmethod + @abc.abstractproperty + raise NotImplementedError + return NotImplemented + +[mypy] +disallow_any_decorated = true +disallow_any_generics = true +disallow_any_unimported = false +disallow_subclassing_any = false +disallow_untyped_calls = true +disallow_untyped_defs = true +ignore_missing_imports = true +warn_unused_ignores = true +warn_return_any = true diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..3c5675a --- /dev/null +++ b/setup.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python +# coding: utf-8 + +import configparser +import setuptools +from setuptools.command.sdist import sdist as _sdist + +try: + import astor +except ImportError as err: + astor = err + + +class sdist(_sdist): + """A `sdist` that generates a `pyproject.toml` on the fly. + """ + + def run(self): + # build `pyproject.toml` from `setup.cfg` + c = configparser.ConfigParser() + c.add_section("build-system") + c.set("build-system", "requires", str(self.distribution.setup_requires)) + c.set("build-system", 'build-backend', '"setuptools.build_meta"') + with open("pyproject.toml", "w") as pyproject: + c.write(pyproject) + # run the rest of the packaging + _sdist.run(self) + + +if __name__ == "__main__": + setuptools.setup(cmdclass=dict(sdist=sdist))