Last active
August 12, 2025 17:32
-
Star
(130)
You must be signed in to star a gist -
Fork
(19)
You must be signed in to fork a gist
-
-
Save althonos/6914b896789d3f2078d1e6237642c35c to your computer and use it in GitHub Desktop.
A `setup.cfg` template for my Python projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://gist.github.com/althonos/6914b896789d3f2078d1e6237642c35c | |
[metadata] | |
name = {name} | |
version = file: {name}/_version.txt | |
author = Martin Larralde | |
author_email = [email protected] | |
url = https://github.com/althonos/{name} | |
description = {description} | |
long_description = file: README.md | |
long_description_content_type = text/markdown | |
license = MIT | |
license_file = COPYING | |
platform = any | |
keywords = {keywords} | |
classifiers = | |
Development Status :: 3 - Alpha | |
Intended Audience :: Developers | |
License :: OSI Approved :: MIT License | |
Operating System :: OS Independent | |
Programming Language :: Python | |
Programming Language :: Python :: 3.4 | |
Programming Language :: Python :: 3.5 | |
Programming Language :: Python :: 3.6 | |
Programming Language :: Python :: 3.7 | |
Programming Language :: Python :: 3.8 | |
Topic :: Software Development :: Libraries :: Python Modules | |
project_urls = | |
Bug Tracker = https://github.com/althonos/{name}/issues | |
Changelog = https://github.com/althonos/{name}/blob/master/CHANGELOG.md | |
[options] | |
zip_safe = false | |
include_package_data = true | |
python_requires = >= 2.7, != 3.0.*, != 3.1.*, != 3.2.* | |
packages = {name} | |
test_suite = tests | |
setup_requires = | |
setuptools | |
# setuptools >=30.3.0 # minimal version for `setup.cfg` | |
# setuptools >=38.3.0 # version with most `setup.cfg` bugfixes | |
# setuptools >=46.4.0 # let's you use attr: to extract version from a module | |
install_requires = | |
{install_requires} | |
tests_require = | |
{tests_require} | |
[options.package_data] | |
{name} = py.typed, _version.txt, *.pyi | |
[bdist_wheel] | |
universal = true | |
[sdist] | |
formats = zip, gztar | |
[coverage:report] | |
show_missing = true | |
exclude_lines = | |
pragma: no cover | |
if False | |
# @abc.abstractmethod | |
# @abc.abstractproperty | |
# raise NotImplementedError | |
# return NotImplemented | |
# except ImportError | |
# raise MemoryError | |
# if __name__ == .__main__.: | |
# if typing.TYPE_CHECKING: | |
[green] | |
file-pattern = test_*.py | |
verbose = 2 | |
no-skip-report = true | |
quiet-stdout = true | |
run-coverage = true | |
[pydocstyle] | |
match-dir = (?!tests)(?!resources)(?!docs)[^\.].* | |
match = (?!test)(?!setup)[^\._].*\.py | |
inherit = false | |
ignore = D200, D203, D213, D406, D407 # Google conventions | |
[flake8] | |
max-line-length = 99 | |
doctests = True | |
exclude = .git, .eggs, __pycache__, tests/, docs/, build/, dist/ | |
[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 |
Hi,
{name}, is an auto-format ? no need to specify anyware ? Like response to kyweez, if package strcuture is the same, {name} call directlly myawesomepackage ? regards,
Hi
Can you give me an example if my package has a sub package.
IF the folder structure is
main package
Sub package 1
sub package 2
myinifile.ini
How to include this ini file in setup.cfg ?
Also is there a possibility to include external wheel packages which need to be installed while mypackage_v1.0.0.whl installs itself ?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ha, ok i see.
Thank you for sharing