This repository has been archived by the owner on May 9, 2022. It is now read-only.
-
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.
- Loading branch information
1 parent
b2574c2
commit ffb6c07
Showing
4 changed files
with
136 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,90 @@ | ||
# Python CircleCI 2.0 configuration file | ||
# | ||
# Check https://circleci.com/docs/2.0/language-python/ for more details | ||
# | ||
version: 2 | ||
jobs: | ||
build: | ||
docker: | ||
- image: circleci/python:3.6.1 | ||
|
||
working_directory: ~/repo | ||
|
||
steps: | ||
- checkout | ||
|
||
# Download and cache dependencies | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "setup.py" }} | ||
|
||
- run: | ||
name: install dependencies | ||
command: | | ||
python3 -m venv venv | ||
. venv/bin/activate | ||
make dev | ||
- save_cache: | ||
paths: | ||
- ./venv | ||
key: v1-dependencies-{{ checksum "setup.py" }} | ||
|
||
deploy: | ||
docker: | ||
- image: circleci/python:3.6 | ||
steps: | ||
- checkout | ||
|
||
- restore_cache: | ||
key: v1-dependency-cache-{{ checksum "setup.py" }} | ||
|
||
- run: | ||
name: install python dependencies | ||
command: | | ||
python3 -m venv venv | ||
. venv/bin/activate | ||
make dev | ||
- save_cache: | ||
key: v1-dependency-cache-{{ checksum "setup.py" }} | ||
paths: | ||
- "venv" | ||
|
||
- run: | ||
name: verify git tag vs. version | ||
command: | | ||
python3 -m venv venv | ||
. venv/bin/activate | ||
python setup.py verify | ||
- run: | ||
name: init .pypirc | ||
command: | | ||
echo -e "[pypi]" >> ~/.pypirc | ||
echo -e "username = io_exception" >> ~/.pypirc | ||
echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc | ||
- run: | ||
name: create packages | ||
command: | | ||
make package | ||
- run: | ||
name: upload to pypi | ||
command: | | ||
. venv/bin/activate | ||
twine upload dist/* | ||
workflows: | ||
version: 2 | ||
build_and_deploy: | ||
jobs: | ||
- build: | ||
filters: | ||
tags: | ||
only: /.*/ | ||
- deploy: | ||
requires: | ||
- build | ||
filters: | ||
tags: | ||
only: /[0-9]+(\.[0-9]+)*/ | ||
branches: | ||
ignore: /.*/ |
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,9 +1,16 @@ | ||
run: install | ||
jupyter notebook | ||
install: clean | ||
pip install -e . | ||
jupyter serverextension enable --py jupygit --sys-prefix | ||
jupyter nbextension install --py jupygit --sys-prefix | ||
jupyter nbextension enable --py jupygit --sys-prefix | ||
.PHONY: help clean dev docs package test | ||
|
||
help: | ||
@echo "This project assumes that an active Python virtualenv is present." | ||
@echo "The following make targets are available:" | ||
@echo " dev install all deps for dev env" | ||
|
||
clean: | ||
find . -type d -name "__pycache__" -exec rm -rf {} + | ||
rm -rf dist/* | ||
|
||
dev: | ||
pip install -r requirements.txt | ||
|
||
package: | ||
python setup.py sdist | ||
python setup.py bdist_wheel |
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 @@ | ||
twine |
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,21 +1,39 @@ | ||
from setuptools import setup, find_packages | ||
import os | ||
import sys | ||
|
||
try: | ||
long_desc = open('README.md').read() | ||
except: | ||
long_desc = '' | ||
from setuptools import setup | ||
from setuptools.command.install import install | ||
|
||
with open("README.md", "r") as fh: | ||
long_description = fh.read() | ||
|
||
# Package version | ||
VERSION = "0.1.0" | ||
|
||
class VerifyVersionCommand(install): | ||
"""Custom command to verify that the git tag matches our version""" | ||
description = 'verify that the git tag matches our version' | ||
|
||
def run(self): | ||
tag = os.getenv('CIRCLE_TAG') | ||
|
||
if tag != VERSION: | ||
info = "Git tag: {0} does not match the version of this library: {1}".format( | ||
tag, VERSION | ||
) | ||
sys.exit(info) | ||
|
||
setup( | ||
name="jupygit", | ||
url="https://github.com/fferegrino/jupygit", | ||
author="Antonio Feregrino", | ||
author_email="[email protected]", | ||
version="0.0.26", | ||
packages=find_packages(), | ||
install_requires=[ | ||
"jupyter==1" | ||
], | ||
include_package_data=True, | ||
version=VERSION, | ||
description="Prepare your Notebooks to be pushed to GitHub", | ||
long_description=long_desc, | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
include_package_data=True, | ||
cmdclass={ | ||
'verify': VerifyVersionCommand, | ||
} | ||
) |