Last active
January 27, 2021 00:16
-
-
Save podhmo/ab8b05a600554217a3d90a0624c053e2 to your computer and use it in GitHub Desktop.
This file contains 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
import logging | |
from ._version import __version__ # noqa:F401 | |
logger = logging.getLogger(__name__) |
This file contains 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
__version__ = "0.0.0" |
This file contains 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
test: | |
pytest -vv --show-capture=all | |
ci: | |
pytest --show-capture=all --cov=foo --no-cov-on-fail --cov-report term-missing | |
$(MAKE) lint typing | |
format: | |
# pip install -e .[dev] | |
black foo setup.py | |
# https://www.flake8rules.com/rules/W503.html | |
# https://www.flake8rules.com/rules/E203.html | |
# https://www.flake8rules.com/rules/E501.html | |
lint: | |
# pip install -e .[dev] | |
flake8 foo --ignore W503,E203,E501 | |
typing: | |
# pip install -e .[dev] | |
mypy --strict --strict-equality --ignore-missing-imports foo | |
mypy: typing | |
#### for pypi #################### | |
get-version: | |
python -c 'import foo as m; print(m.__version__)' | |
build: | |
# pip install wheel | |
python setup.py sdist bdist_wheel | |
upload: | |
# pip install twine | |
twine check dist/foo-$(shell make -s get-version)* | |
twine upload dist/foo-$(shell make -s get-version)*.tar.gz | |
twine upload dist/foo-$(shell make -s get-version)*.whl | |
.PHONY: test ci format lint typing mypy build upload |
This file contains 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
# see: https://setuptools.readthedocs.io/en/latest/setuptools.html#specifying-values | |
[metadata] | |
name = foo | |
version = attr: foo._version.__version__ | |
summary = - | |
long_description = file:README.md | |
long_description_content_type = text/markdown; charset=UTF-8; variant=GFM | |
url = https://github.com/podhmo/foo | |
author = podhmo | |
author_email = ababjam61+github@gmail.com | |
[options] | |
include_package_data = True | |
zip_safe = False | |
[bdist_wheel] | |
universal=0 |
This file contains 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
from setuptools import setup, find_packages | |
install_requires = [] | |
dev_requires = ["black", "flake8", "mypy"] | |
tests_requires = ["pytest"] | |
setup( | |
classifiers=[ | |
# "License :: OSI Approved :: MIT License", | |
"Programming Language :: Python :: 3", | |
# How mature is this project? Common values are | |
# 3 - Alpha | |
# 4 - Beta | |
# 5 - Production/Stable | |
"Development Status :: 3 - Alpha", | |
], | |
python_requires=">=3.7", | |
packages=find_packages(exclude=["foo.tests"]), | |
install_requires=install_requires, | |
extras_require={"testing": tests_requires, "dev": dev_requires}, | |
tests_require=tests_requires, | |
test_suite="foo.tests", | |
# entry_points=""" | |
# [console_scripts] | |
# foo = foo.cli:main | |
# """, | |
) |
This file contains 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
. | |
├── Makefile | |
├── README.md | |
├── foo | |
│ ├── __init__.py | |
│ ├── _version.py | |
│ └── tests | |
│ └── __init__.py | |
├── setup.cfg | |
├── setup.py | |
└── tree.output | |
2 directories, 8 files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment