-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to add Travis and make installable
- Loading branch information
1 parent
a1bd575
commit 5070002
Showing
13 changed files
with
188 additions
and
20 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,3 @@ | ||
[flake8] | ||
max-line-length=120 | ||
ignore: E301, E302, E401, E261, E265, E226, F401, E501 |
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,14 @@ | ||
language: python | ||
python: | ||
- '3.6' | ||
install: | ||
- make develop | ||
script: | ||
- make test | ||
deploy: | ||
provider: pypi | ||
on: | ||
tags: true | ||
user: jessebrennan | ||
password: | ||
'foo' |
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,3 @@ | ||
include README.md VERSION release.py | ||
include *.txt | ||
recursive-include src |
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,32 @@ | ||
MODULES=src test | ||
|
||
all: test | ||
|
||
lint: | ||
flake8 $(MODULES) | ||
|
||
check_readme: | ||
python setup.py check -r -s | ||
|
||
tests:=$(wildcard test/test_*.py) | ||
|
||
# A pattern rule that runs a single test module, for example: | ||
# make tests/test_gen3_input_json.py | ||
|
||
$(tests): %.py : mypy lint check_readme | ||
python -m unittest --verbose $*.py | ||
|
||
test: $(tests) | ||
|
||
develop: | ||
pip install -e . | ||
pip install -r requirements.dev.txt | ||
|
||
undevelop: | ||
python setup.py develop --uninstall | ||
pip uninstall -y -r requirements.dev.txt | ||
|
||
release: test | ||
python release.py $(VERSION) | ||
|
||
.PHONY: all lint mypy test develop undevelop release |
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 @@ | ||
0.0.1 |
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,64 @@ | ||
#!/usr/bin/env python3 | ||
import re | ||
import sys | ||
|
||
# | ||
# a basic release automation script | ||
# | ||
# This should only be called from the Makefile | ||
# | ||
|
||
VERSION_FILE = 'VERSION' | ||
|
||
help_message = ("The argument must be formatted as either 'major', 'minor', 'patch' or 'X.X.X'\n" | ||
"\n" | ||
"If one of the first three options is used than that part of the version will\n" | ||
"be incremented and all lesser parts of the version will be reset to 0.") | ||
|
||
|
||
def read_version(): | ||
with open(VERSION_FILE, 'r') as fp: | ||
return tuple(map(int, fp.read().split('.'))) | ||
|
||
|
||
def write_version(major, minor, patch): | ||
with open(VERSION_FILE, 'w') as fp: | ||
fp.write(f'{major}.{minor}.{patch}') | ||
|
||
|
||
def main(): | ||
# when called from the makefile we expect only 1 arg | ||
assert len(sys.argv) == 2 | ||
|
||
arg = sys.argv[1] | ||
|
||
major, minor, patch = read_version() | ||
print(f'Previous version set to {major}.{minor}.{patch}') | ||
|
||
if arg == 'help': | ||
print(help_message, file=sys.stderr) | ||
exit(0) | ||
elif arg == 'major': | ||
major += 1 | ||
minor = 0 | ||
patch = 0 | ||
elif arg == 'minor': | ||
minor += 1 | ||
patch = 0 | ||
elif arg == 'patch': | ||
patch += 1 | ||
# of form X.X.X | ||
elif re.match('^\d*\.\d*\.\d*$', arg): | ||
major, minor, patch = tuple(arg.split('.')) | ||
else: | ||
print(help_message, file=sys.stderr) | ||
exit(1) | ||
|
||
write_version(major, minor, patch) | ||
print(f'New version successfully set to {major}.{minor}.{patch}. To finish release, commit\n' | ||
'changes. Then create a release on github with this version number. Travis will\n' | ||
'automatically upload to PyPI') | ||
|
||
|
||
if __name__ == '__main__': | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
flake8 | ||
ipython | ||
docutils |
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 @@ | ||
. |
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,40 @@ | ||
from setuptools import setup, find_packages | ||
from os import path | ||
|
||
from release import read_version | ||
|
||
here = path.abspath(path.dirname(__file__)) | ||
|
||
# Get the long description from the README file | ||
with open(path.join(here, 'README.md'), encoding='utf-8') as f: | ||
long_description = f.read() | ||
|
||
|
||
setup( | ||
name='cutest', | ||
version='{}.{}.{}'.format(*read_version()), | ||
description='A cute, composable unit test framework for Python', | ||
long_description=long_description, | ||
long_description_content_type='text/markdown', | ||
url='https://github.com/jessebrennan/cutest', | ||
author='jessebrennan', | ||
author_email='brennan@pacific.net', | ||
classifiers=[ | ||
'Development Status :: 2 - Pre-Alpha', | ||
'Intended Audience :: Developers', | ||
'Topic :: Software Development :: Testing', | ||
'License :: OSI Approved :: MIT License', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
], | ||
package_dir={'': 'src'}, | ||
packages=find_packages(where='src'), | ||
python_requires='>=3.6, <4', | ||
install_requires=[], | ||
entry_points={ # Optional | ||
'console_scripts': [ | ||
'cutest=cutest: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
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 |
---|---|---|
|
@@ -61,4 +61,3 @@ def __exit__(self, exc_type, exc_val, exc_tb): | |
|
||
def fix_method(self): | ||
print('fix_2 method') | ||
|
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