Skip to content

Commit

Permalink
Merge pull request #231 from paxtonfitzpatrick/master
Browse files Browse the repository at this point in the history
dealing with pip, setuptools, and non-PyPI dependencies
  • Loading branch information
paxtonfitzpatrick committed Dec 18, 2019
2 parents 4808f9e + 3c335f5 commit eca7cff
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 19 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
@@ -0,0 +1 @@
include requirements.txt
Binary file modified docs/auto_examples/analyze_codeobj.pickle
Binary file not shown.
Binary file modified docs/auto_examples/save_image_codeobj.pickle
Binary file not shown.
Binary file modified docs/auto_examples/save_movie_codeobj.pickle
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/conf.py
Expand Up @@ -68,7 +68,7 @@
# The short X.Y version.
version = u'0.6'
# The full version, including alpha/beta/rc tags.
release = u'0.6.0'
release = u'0.6.2'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Expand Up @@ -5,8 +5,8 @@ seaborn>=0.8.1
matplotlib>=1.5.1
scipy>=1.0.0
numpy>=1.10.4
https://api.github.com/repos/lmcinnes/umap/tarball/5f9488a9540d1e0ac149e2dd42ebf03c39706110#egg=umap_learn
future
requests
deepdish
six
# also requires umap-learn. However, due to a recent bug fix that has not been released on PyPI yet, umap-learn is installed from GitHub in setup.py
37 changes: 20 additions & 17 deletions setup.py
@@ -1,36 +1,34 @@
# -*- coding: utf-8 -*-
import os
import subprocess
import sys
from setuptools import setup, find_packages
from setuptools.command.install import install

os.environ["MPLCONFIGDIR"] = "."


def parse_dependencies(requirements_path, vcs_id, egg_id):
requirements = []
with open(requirements_path, 'r') as f:
reqs = f.read().splitlines()
class PostInstall(install):
github_pkg = 'https://api.github.com/repos/lmcinnes/umap/tarball/5f9488a9540d1e0ac149e2dd42ebf03c39706110#egg=umap_learn'

for req in reqs:
if req.startswith(vcs_id) and egg_id in req:
package_name = req[req.find(egg_id) + len(egg_id):]
requirements.append(package_name + ' @ ' + req.rstrip(egg_id + package_name))
else:
requirements.append(req)

return requirements
def run(self):
install.run(self)
output = subprocess.run([sys.executable, '-m', 'pip', 'install', self.github_pkg],
stdout=subprocess.PIPE)
print(output.stdout.decode('utf-8'))


NAME = 'hypertools'
VERSION = '0.6.0'
VERSION = '0.6.2'
AUTHOR = 'Contextual Dynamics Lab'
AUTHOR_EMAIL = 'contextualdynamics@gmail.com'
URL = 'https://github.com/ContextLab/hypertools'
DOWNLOAD_URL = URL
LICENSE = 'MIT'
REQUIRES_PYTHON = '>=3'
REQUIRES_PYTHON = '>=3.5'
PACKAGES = find_packages(exclude=('images', 'examples', 'tests'))
REQUIREMENTS = parse_dependencies('requirements.txt', 'https://api.github.com', '#egg=')

with open('requirements.txt', 'r') as f:
REQUIREMENTS = f.read().splitlines()

DESCRIPTION = 'A python package for visualizing and manipulating high-dimensional data'
LONG_DESCRIPTION = """\
Expand All @@ -57,7 +55,11 @@ def parse_dependencies(requirements_path, vcs_id, egg_id):
'Topic :: Multimedia :: Graphics',
'Operating System :: POSIX',
'Operating System :: Unix',
'Operating System :: MacOS']
'Operating System :: MacOS'
]
CMDCLASS = {
'install': PostInstall
}


setup(
Expand All @@ -74,4 +76,5 @@ def parse_dependencies(requirements_path, vcs_id, egg_id):
packages=PACKAGES,
install_requires=REQUIREMENTS,
classifiers=CLASSIFIERS,
cmdclass=CMDCLASS,
)

0 comments on commit eca7cff

Please sign in to comment.