Skip to content

Commit

Permalink
Merge pull request #6 from Autodesk/0.6.6_release
Browse files Browse the repository at this point in the history
Merged and pushed to pypi
  • Loading branch information
avirshup authored Oct 4, 2016
2 parents 7719426 + cada736 commit 0aa98c7
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 60 deletions.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@ include pyccc/_version.py
include requirements.txt
include LICENSE
include README.md
recursive-include pyccc/static *.*
recursive-include pyccc/tests *.*
global-exclude *.py[cod] __pycache__ *~ *.bak

69 changes: 69 additions & 0 deletions prep_release.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#!/usr/bin/env python
""" This script builds and runs automated tests for a new moldesign release.
It's manual for now, will be replaced by Travis or Jenkins soon.
You shouldn't run this unless you know exactly what you're doing and why you're doing it
"""

import os
import sys
import subprocess
import atexit

version = sys.argv[1]


def run(cmd, display=True):
print '\n>>> %s' % cmd
if display:
return subprocess.check_call(cmd, shell=True)
else:
return subprocess.check_output(cmd, shell=True)


tags = set(run('git tag --list', display=False).splitlines())
rootdir = run('git rev-parse --show-toplevel', display=False).strip()

assert os.path.abspath(rootdir) == os.path.abspath(os.path.curdir), \
"This command must be run at root of the repository directory"

# check that tag is valid
assert version not in tags, "Tag %s already exists!" % version
major, minor, patch = map(int, version.split('.'))


# Set the tag!
run('git tag %s' % version)
print 'Tag set: %s' % version


def untag():
if not untag.success:
print 'Failed. Removing version tag %s' % version
run('git tag -d %s' % version)

untag.success = False

atexit.register(untag)

# Check that it propagated to the python package
import pyccc
assert os.path.abspath(os.path.join(pyccc.__path__[0],'..')) == os.path.abspath(rootdir)
assert pyccc.__version__ == version, 'Package has incorrect version: %s' % pyccc.__version__

untag.success = True

# This is the irreversible part - so do it manually
print """
This LOOKS ready for release! Do the following to create version %s.
If you're ready, run these commands:
1. python setup.py register -r pypi
2. python setup.py sdist upload -r pypi
3. git push origin master --tags
Finally, mark it as release "v%s" in GitHub.
TO ABORT, RUN:
git tag -d %s
""" % (version, version, version)

43 changes: 0 additions & 43 deletions pyccc/dockerfiles/DockerMake.yaml

This file was deleted.

7 changes: 6 additions & 1 deletion pyccc/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,14 @@ def _fetch(self):
See http://stackoverflow.com/questions/22683410/docker-python-client-api-copy
"""
import docker

self._open_tmpfile()
client = docker.Client(**self.dockerhost)
request = client.copy(self.containerid, self.containerpath)
args = (self.containerid, self.containerpath)
if hasattr(client, 'get_archive'): # handle different docker-py versions
request, meta = client.get_archive(*args)
else:
request = client.copy(*args)

# from stackoverflow link
filelike = StringIO.StringIO(request.read())
Expand Down
17 changes: 1 addition & 16 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import os
from os.path import relpath, join

import sys
from setuptools import find_packages, setup
import versioneer
Expand Down Expand Up @@ -30,24 +27,12 @@
requirements = [x.strip() for x in reqfile if x.strip()]


def find_package_data(pkgdir):
""" Just include all files that won't be included as package modules.
"""
files = []
for root, dirnames, filenames in os.walk(pkgdir):
not_a_package = '__init__.py' not in filenames
for fn in filenames:
basename, fext = os.path.splitext(fn)
if not_a_package or (fext not in PYEXT) or ('static' in fn):
files.append(relpath(join(root, fn), pkgdir))
return files

setup(
name=PACKAGE_NAME,
version=versioneer.get_version(),
classifiers=CLASSIFIERS.splitlines(),
packages=find_packages(),
package_data={PACKAGE_NAME: find_package_data(PACKAGE_NAME)},
include_package_data=True,
cmdclass=versioneer.get_cmdclass(),
install_requires=requirements,
url='http://github.com/autodesk/py-cloud-compute-cannon',
Expand Down

0 comments on commit 0aa98c7

Please sign in to comment.