Skip to content
This repository has been archived by the owner on Oct 25, 2021. It is now read-only.

Commit

Permalink
enable zipping all dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Rett Berg committed Aug 23, 2019
1 parent 3e8bffe commit 8453525
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
py2/
py3/
pycheck/
py*/
dist/
artifact_py.egg-info/
21 changes: 18 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
version = "0.1.2"
fullname = "artifact_py-$(version)"
zip_dir = "dist/$(fullname)/"


check: fix test
# SHIP IT!

Expand All @@ -7,18 +12,28 @@ ship: check
pycheck/bin/pip install .
py3/bin/python setup.py sdist
# run: py3/bin/twine upload dist/*
# also run `make zipit` and upload that

zipit:
rm -rf $(zip_dir) "dist/$(fullname).zip"
mkdir -p $(zip_dir)
cp -r artifact_py/ $(zip_dir)
mv $(zip_dir)/artifact_py/bin/artifact_py_local $(zip_dir)/artifact_py/bin/artifact_py
for pkg in decorator.py six.py anchor_txt/ networkx/ yaml/ ; do \
cp -r py3/lib/python*/site-packages/$$pkg $(zip_dir); \
done
cd dist && zip -r "$(fullname).zip" "$(fullname)"



init:
# python2
virtualenv --python=python2 py2
py2/bin/pip install -r requirements.txt
py2/bin/pip install -e ../anchor_txt
py2/bin/pip install pytest
# python3
virtualenv --python=python3 py3
py3/bin/pip install -r requirements.txt
py3/bin/pip install -e ../anchor_txt
py3/bin/pip install pytest yapf pylint twine

fix:
Expand All @@ -39,4 +54,4 @@ test3:
test: test3 test2

clean:
rm -rf py2 py3 dist anchor_txt.egg-info
rm -rf py2 py3 dist artifact_py.egg-info
15 changes: 15 additions & 0 deletions artifact_py/bin/artifact_py_local
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python
import os
import sys


def recurse(path, times):
for t in range(times):
path = os.path.dirname(path)
return path


sys.path.append(recurse(os.path.abspath(__file__), 3))

import artifact_py
sys.exit(artifact_py.main(sys.argv[1:]))
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def read(*names, **kwargs):
setup(
name = 'artifact_py',
packages = ['artifact_py'],
version = '0.1.1',
version = '0.1.2',
license='MIT or APACHE-2.0',
description = 'The design documentation tool for everyone',
long_description=read('README.md'),
Expand Down

0 comments on commit 8453525

Please sign in to comment.