-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds Makefile and bumpversion and updates distribution config
- Loading branch information
Showing
4 changed files
with
94 additions
and
14 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[bumpversion] | ||
current_version = 0.0.1 | ||
commit = False | ||
tag = False | ||
|
||
[bumpversion:file:setup.py] | ||
search = version = {current_version} | ||
replace = {new_version} | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.PHONY: help build clean clean-build setup setup-dev release-check flake8-check twine-release-test | ||
|
||
.DEFAULT: help | ||
help: | ||
@echo "make build" | ||
@echo " build distribution directories" | ||
@echo "make clean" | ||
@echo " clean virtual environment and distribution" | ||
@echo "make clean-build" | ||
@echo " clean distribution directories" | ||
@echo "make setup" | ||
@echo " setup development environment" | ||
@echo "make setup-dev" | ||
@echo " setup virtualenv and development environment" | ||
@echo "make flake8-check" | ||
@echo " run flake8 code style check" | ||
@echo "make release-check" | ||
@echo " run release checks" | ||
@echo "make twine-release-test" | ||
@echo " release to test pypi using twine" | ||
|
||
build: clean-build | ||
@echo ">>> building ftoolz distribution" | ||
python setup.py sdist | ||
|
||
clean: clean-build | ||
rm -rf venv | ||
|
||
clean-build: | ||
rm -rf dist | ||
rm -rf build | ||
rm -rf *.egg-info | ||
|
||
setup: clean | ||
pip install -U -e .[dev,test] | ||
|
||
setup-dev: clean | ||
virtualenv -p python3 venv | ||
./venv/bin/pip install -U pip | ||
./venv/bin/pip install -U setuptools | ||
./venv/bin/pip install -U -e .[dev,test] | ||
|
||
flake8-check: | ||
@echo ">>> enforcing PEP 8 style with flake8 in cytoolz-stubs" | ||
flake8 --config=.flake8 cytoolz-stubs || ( echo ">>> flake8 check failed"; exit 1; ) | ||
|
||
release-check: flake8-check | ||
|
||
twine-release-test: build | ||
python3 -m twine upload --repository-url https://test.pypi.org/legacy/ dist/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,58 @@ | ||
import os | ||
from typing import Mapping, Sequence | ||
|
||
from setuptools import setup | ||
|
||
|
||
def find_stubs(package): | ||
stubs = [] | ||
for root, dirs, files in os.walk(package): | ||
for file in files: | ||
path = os.path.join(root, file).replace(package + os.sep, '', 1) | ||
stubs.append(path) | ||
def find_stubs(package: str) -> Mapping[str, Sequence[str]]: | ||
stubs = [ | ||
os.path.join(root, file).replace(package + os.sep, '', 1) | ||
for root, dirs, files in os.walk(package) | ||
for file in files | ||
] | ||
return {package: stubs} | ||
|
||
|
||
requirements = [ | ||
'cytoolz==0.9.0.1', | ||
] | ||
|
||
dev_requirements = [ | ||
'bumpversion==0.5.3', | ||
'twine==1.13.0', | ||
] | ||
|
||
test_requirements = [ | ||
'flake8==3.7.7', | ||
] | ||
|
||
version = '0.0.1' | ||
|
||
setup( | ||
name='cytoolz-stubs', | ||
maintainer="Martin Matyasek", | ||
maintainer_email="[email protected]", | ||
description="PEP 561 type stubs for cytoolz", | ||
url="https://github.com/blindspot-ai/cytoolz-stubs", | ||
version=version, | ||
license='MIT', | ||
version="0.0.1", | ||
description='PEP 561 type stubs for cytoolz', | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
'Environment :: Console', | ||
'Intended Audience :: Developers', | ||
'Natural Language :: English', | ||
'Operating System :: Unix', | ||
'Programming Language :: Python', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
], | ||
url='https://github.com/blindspot-ai/cytoolz-stubs', | ||
maintainer='Martin Matyasek', | ||
maintainer_email='[email protected]', | ||
keywords='cytoolz stubs', | ||
packages=['cytoolz-stubs'], | ||
zip_safe=False, | ||
python_requires='>=3.6', | ||
install_requires=requirements, | ||
extras_require={'test': test_requirements}, | ||
extras_require={'dev': dev_requirements, 'test': test_requirements}, | ||
tests_require=requirements + test_requirements, | ||
package_data=find_stubs('cytoolz-stubs'), | ||
) |