Skip to content

Instantly share code, notes, and snippets.

@podhmo
Last active January 27, 2021 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save podhmo/ab8b05a600554217a3d90a0624c053e2 to your computer and use it in GitHub Desktop.
Save podhmo/ab8b05a600554217a3d90a0624c053e2 to your computer and use it in GitHub Desktop.
import logging
from ._version import __version__ # noqa:F401
logger = logging.getLogger(__name__)
__version__ = "0.0.0"
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
# 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
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
# """,
)
.
├── 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