Skip to content

Commit

Permalink
Convert to Package. Add Tests. Refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
pcstout authored Nov 20, 2019
1 parent 5803d93 commit 49f1136
Show file tree
Hide file tree
Showing 26 changed files with 2,093 additions and 348 deletions.
20 changes: 20 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
environment:
PYTHONIOENCODING: UTF-8
LOG_LEVEL: DEBUG
matrix:
- PYTHON: "C:\\Python36-x64"
- PYTHON: "C:\\Python37-x64"

install:
- set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%
- pip install pipenv
- pipenv --python=%PYTHON%\\python.exe
- pipenv lock -r >> requirements.txt
- pipenv lock -r --dev >> requirements.txt
- pip install -r requirements.txt

build: off

test_script:
- python --version
- pytest -v -s --cov
6 changes: 6 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[run]
branch = True
source =
src
omit =
*/tests/*
27 changes: 25 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
.vscode
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
*.pyc

.idea
.venv
log.txt
.vscode
.coverage
htmlcov
tests/private.*
*.log
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
sudo: false
language: python
matrix:
include:
- os: linux
python: 3.6
- os: linux
python: 3.7
- os: osx
language: generic
env: PYENV_VERSION=3.6.8
- os: osx
language: generic
env: PYENV_VERSION=3.7.4
install:
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then brew update ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then brew outdated pyenv || brew upgrade pyenv ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then pyenv install $PYENV_VERSION ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then ~/.pyenv/versions/$PYENV_VERSION/bin/python -m venv .venv ; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ] ; then source .venv/bin/activate ; fi
- python --version
- python -m pip install -U pip
- python -m pip install -U pipenv
- pipenv install --dev
- pip install coveralls
before_script:
- python -m coverage erase
script:
- python --version
- python -m pytest -v -s --cov
after_success:
- python -m coveralls
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Change Log

## Version 0.0.1 (2019-11-20)
### Added
- Initial release.
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include LICENSE
include NOTICE
include README.md
47 changes: 47 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.PHONY: pip_install
pip_install:
pipenv install --dev


.PHONY: test
test:
pytest -v --cov --cov-report=term --cov-report=html


.PHONY: build
build: clean
python setup.py sdist
python setup.py bdist_wheel
twine check dist/*


.PHONY: clean
clean:
rm -rf ./build/*
rm -rf ./dist/*
rm -rf ./htmlcov


.PHONY: install_local
install_local:
pip install -e .


.PHONY: install_test
install_test:
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple synapse-uploader


.PHONY: publish_test
publish_test: build
twine upload --repository-url https://test.pypi.org/legacy/ dist/*


.PHONY: publish
publish: build
twine upload dist/*


.PHONY: uninstall
uninstall:
pip uninstall -y synapse-uploader
13 changes: 13 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Copyright 2019-present, Bill & Melinda Gates Foundation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
22 changes: 22 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]
pytest = "*"
pylint = "*"
pytest-mock = "*"
pytest-pylint = "*"
pytest-cov = "*"
coverage = "*"
coveralls = "*"
twine = "*"
wheel = "*"
autopep8 = "*"

[packages]
synapseclient = "*"

[requires]
python_version = "3.7"
Loading

0 comments on commit 49f1136

Please sign in to comment.