Skip to content

Commit

Permalink
Merge pull request #146 from jhlegarreta/UseRequirementsFileForDepend…
Browse files Browse the repository at this point in the history
…List

ENH: Use a `requirements.txt` file to list the external dependencies
  • Loading branch information
ljod authored Sep 21, 2023
2 parents 9485556 + e38b03c commit cebf9f0
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 14 deletions.
11 changes: 11 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cython==0.29.*
joblib==1.1.*
matplotlib==3.6.*
nibabel==3.0.*
numpy==1.20.*
pandas==2.0.3
setuptools==44.0.*
scipy==1.4.*
statsmodels==0.10.*
vtk==9.1.*
xlrd
32 changes: 18 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import os, glob
from distutils.core import setup

import setuptools
from setuptools import setup, Extension, Command
from setuptools.command.build_ext import build_ext as _build_ext
import os
from setuptools import setup
from pkg_resources import resource_filename

# url='http://pypi.python.org/pypi/WhiteMatterAnalysis/',
Expand All @@ -19,6 +15,7 @@
os.environ['MSSdk'] = '1'
os.environ['DISTUTILS_USE_SDK'] = '1'


########################################################################
# Begin attribution section
########################################################################
Expand Down Expand Up @@ -77,6 +74,18 @@ def build_extensions(self):
########################################################################


with open("requirements.txt") as f:
required_dependencies = f.read().splitlines()
external_dependencies = []
for dependency in required_dependencies:
if dependency[0:2] == "-e":
repo_name = dependency.split("=")[-1]
repo_url = dependency[3:]
external_dependencies.append("f{repo_name} @ {repo_url}")
else:
external_dependencies.append(dependency)


setup_requires = ['cython==0.29.*', 'numpy==1.20.*']
setup(
name='WhiteMatterAnalysis',
Expand All @@ -87,15 +96,10 @@ def build_extensions(self):
license='LICENSE.txt',
description='Processing of whole-brain streamline tractography.',
long_description=open('README.md').read(),

setup_requires = setup_requires,
install_requires = setup_requires + ['setuptools==44.0.*', 'scipy==1.4.*', 'vtk==9.1.*',
'joblib==1.1.*', 'statsmodels==0.10.*', 'xlrd', 'matplotlib==3.6.*', 'nibabel==3.0.*',
'pandas==2.0.3'],

setup_requires=setup_requires,
install_requires=setup_requires + external_dependencies,
cmdclass=LazyCommandClass(),

scripts = [
scripts=[
'bin/harden_transform_with_slicer.py',
'bin/wm_append_clusters.py',
'bin/wm_append_clusters_to_anatomical_tracts.py',
Expand Down

0 comments on commit cebf9f0

Please sign in to comment.