Loading .gitignore 0 → 100644 +104 −0 Original line number Diff line number Diff line # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ *.egg-info/ .installed.cfg *.egg MANIFEST # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover .hypothesis/ .pytest_cache/ # Translations *.mo *.pot # Django stuff: *.log local_settings.py db.sqlite3 # Flask stuff: instance/ .webassets-cache # Scrapy stuff: .scrapy # Sphinx documentation docs/_build/ # PyBuilder target/ # Jupyter Notebook .ipynb_checkpoints # pyenv .python-version # celery beat schedule file celerybeat-schedule # SageMath parsed files *.sage.py # Environments .env .venv env/ venv/ ENV/ env.bak/ venv.bak/ # Spyder project settings .spyderproject .spyproject # Rope project settings .ropeproject # mkdocs documentation /site # mypy .mypy_cache/ .gitlab-ci.yml 0 → 100644 +82 −0 Original line number Diff line number Diff line variables: TWINE_USERNAME: SECURE TWINE_PASSWORD: SECURE TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/ ANACONDA_USERNAME: SECURE ANACONDA_TOKEN: SECURE DOCKER_PASSWORD: SECURE DOCKER_USERNAME: SECURE stages: - test - deploy - docs test: image: python:3.6 stage: test script: - pip install . - python setup.py test --addopts "--cov=pypkgtemp" deploy_pypi: image: python:3.6 stage: deploy script: - pip install -U twine setuptools - python setup.py sdist bdist_wheel - twine upload dist/*.tar.gz - twine upload dist/*.whl only: - /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags) deploy_conda: image: continuumio/miniconda3:latest stage: deploy script: - conda install anaconda-client setuptools conda-build -y - python setup.py bdist_conda - anaconda -t $ANACONDA_TOKEN upload -u $ANACONDA_USERNAME /opt/conda/conda-bld/linux-64/pypkgtemp*.tar.bz2 only: - /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags) deploy_docker: image: docker:git stage: deploy services: - docker:dind script: - docker build -t python-package-template:$CI_COMMIT_TAG --build-arg VERSION=$CI_COMMIT_TAG . # push to dockerhub - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD - docker tag python-package-template:$CI_COMMIT_TAG costrouc/python-package-template:$CI_COMMIT_TAG - docker tag python-package-template:$CI_COMMIT_TAG costrouc/python-package-template:latest - docker push costrouc/python-package-template:$CI_COMMIT_TAG - docker push costrouc/python-package-template:latest # push to gitlab registry - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com - docker tag python-package-template:$CI_COMMIT_TAG registry.gitlab.com/costrouc/python-package-template:$CI_COMMIT_TAG - docker tag python-package-template:$CI_COMMIT_TAG registry.gitlab.com/costrouc/python-package-template:latest - docker push registry.gitlab.com/costrouc/python-package-template:$CI_COMMIT_TAG - docker push registry.gitlab.com/costrouc/python-package-template:latest only: - /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags) pages: image: python:3.6 stage: docs script: - pip install sphinx sphinx_rtd_theme - pip install -e . - mkdir public - cd docs - make apidocs - make html - cp -r _build/html/* ../public artifacts: paths: - public only: - master .readthedocs.yml 0 → 100644 +6 −0 Original line number Diff line number Diff line build: image: latest python: version: 3.6 setup_py_install: true CHANGELOG.md 0 → 100644 +20 −0 Original line number Diff line number Diff line # Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] ## [1.0.0] - 2018-03-30 ### Added - documentation ([sphinx](http://www.sphinx-doc.org/en/stable/), selfhosted + [readthedocs](https://readthedocs.org/)) - testing ([pytest](https://docs.pytest.org/en/latest/)) - deploy to pypi ([twine](https://github.com/pypa/twine)) - building a package (`setup.py`, `README.md`, `CHANGELOG.md`, `LICENSE.md`) - command line interface with argparse ### Changed ### Removed Dockerfile 0 → 100644 +12 −0 Original line number Diff line number Diff line FROM python:3.6-slim MAINTAINER Chris Ostrouchov ARG VERSION=v1.1.0 ARG USERNAME=costrouc ARG PROJECT=python-package-template # Download package, install package, no cache RUN pip install --no-cache-dir https://gitlab.com/$USERNAME/$PROJECT/repository/$VERSION/archive.tar.gz ENTRYPOINT ["helloworld"] CMD ["fizzbuzz", "-n", "10"] Loading
.gitignore 0 → 100644 +104 −0 Original line number Diff line number Diff line # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ *.egg-info/ .installed.cfg *.egg MANIFEST # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover .hypothesis/ .pytest_cache/ # Translations *.mo *.pot # Django stuff: *.log local_settings.py db.sqlite3 # Flask stuff: instance/ .webassets-cache # Scrapy stuff: .scrapy # Sphinx documentation docs/_build/ # PyBuilder target/ # Jupyter Notebook .ipynb_checkpoints # pyenv .python-version # celery beat schedule file celerybeat-schedule # SageMath parsed files *.sage.py # Environments .env .venv env/ venv/ ENV/ env.bak/ venv.bak/ # Spyder project settings .spyderproject .spyproject # Rope project settings .ropeproject # mkdocs documentation /site # mypy .mypy_cache/
.gitlab-ci.yml 0 → 100644 +82 −0 Original line number Diff line number Diff line variables: TWINE_USERNAME: SECURE TWINE_PASSWORD: SECURE TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/ ANACONDA_USERNAME: SECURE ANACONDA_TOKEN: SECURE DOCKER_PASSWORD: SECURE DOCKER_USERNAME: SECURE stages: - test - deploy - docs test: image: python:3.6 stage: test script: - pip install . - python setup.py test --addopts "--cov=pypkgtemp" deploy_pypi: image: python:3.6 stage: deploy script: - pip install -U twine setuptools - python setup.py sdist bdist_wheel - twine upload dist/*.tar.gz - twine upload dist/*.whl only: - /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags) deploy_conda: image: continuumio/miniconda3:latest stage: deploy script: - conda install anaconda-client setuptools conda-build -y - python setup.py bdist_conda - anaconda -t $ANACONDA_TOKEN upload -u $ANACONDA_USERNAME /opt/conda/conda-bld/linux-64/pypkgtemp*.tar.bz2 only: - /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags) deploy_docker: image: docker:git stage: deploy services: - docker:dind script: - docker build -t python-package-template:$CI_COMMIT_TAG --build-arg VERSION=$CI_COMMIT_TAG . # push to dockerhub - docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD - docker tag python-package-template:$CI_COMMIT_TAG costrouc/python-package-template:$CI_COMMIT_TAG - docker tag python-package-template:$CI_COMMIT_TAG costrouc/python-package-template:latest - docker push costrouc/python-package-template:$CI_COMMIT_TAG - docker push costrouc/python-package-template:latest # push to gitlab registry - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com - docker tag python-package-template:$CI_COMMIT_TAG registry.gitlab.com/costrouc/python-package-template:$CI_COMMIT_TAG - docker tag python-package-template:$CI_COMMIT_TAG registry.gitlab.com/costrouc/python-package-template:latest - docker push registry.gitlab.com/costrouc/python-package-template:$CI_COMMIT_TAG - docker push registry.gitlab.com/costrouc/python-package-template:latest only: - /^v\d+\.\d+\.\d+([abc]\d*)?$/ # PEP-440 compliant version (tags) pages: image: python:3.6 stage: docs script: - pip install sphinx sphinx_rtd_theme - pip install -e . - mkdir public - cd docs - make apidocs - make html - cp -r _build/html/* ../public artifacts: paths: - public only: - master
.readthedocs.yml 0 → 100644 +6 −0 Original line number Diff line number Diff line build: image: latest python: version: 3.6 setup_py_install: true
CHANGELOG.md 0 → 100644 +20 −0 Original line number Diff line number Diff line # Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] ## [1.0.0] - 2018-03-30 ### Added - documentation ([sphinx](http://www.sphinx-doc.org/en/stable/), selfhosted + [readthedocs](https://readthedocs.org/)) - testing ([pytest](https://docs.pytest.org/en/latest/)) - deploy to pypi ([twine](https://github.com/pypa/twine)) - building a package (`setup.py`, `README.md`, `CHANGELOG.md`, `LICENSE.md`) - command line interface with argparse ### Changed ### Removed
Dockerfile 0 → 100644 +12 −0 Original line number Diff line number Diff line FROM python:3.6-slim MAINTAINER Chris Ostrouchov ARG VERSION=v1.1.0 ARG USERNAME=costrouc ARG PROJECT=python-package-template # Download package, install package, no cache RUN pip install --no-cache-dir https://gitlab.com/$USERNAME/$PROJECT/repository/$VERSION/archive.tar.gz ENTRYPOINT ["helloworld"] CMD ["fizzbuzz", "-n", "10"]