|
| 1 | +from setuptools import setup, find_packages, find_namespace_packages |
| 2 | +import pathlib |
| 3 | + |
| 4 | +here = pathlib.Path(__file__).parent.resolve() |
| 5 | + |
| 6 | +# workaround a bug introduced by pyproject.toml |
| 7 | +# https://github.com/pypa/pip/issues/7953#issuecomment-645133255 |
| 8 | +import site, sys; site.ENABLE_USER_SITE = True |
| 9 | + |
| 10 | +setup( |
| 11 | + name='spinalcordtoolbox-data-<dataset>', |
| 12 | + description='Part of https://github.com/neuropoly/spinalcordtoolbox', |
| 13 | + long_description=(here / 'README.md').read_text(encoding='utf-8'), |
| 14 | + long_description_content_type='text/markdown', |
| 15 | + author='Neuropoly', |
| 16 | + author_email='neuropoly@googlegroups.com', |
| 17 | + url='https://spinalcordtoolbox.com/', |
| 18 | + project_urls={ |
| 19 | + 'Source': 'https://github.com/sct-data/<dataset>', |
| 20 | + #'Documentation': '', |
| 21 | + }, |
| 22 | + #license='CC-BY-NC', ?? |
| 23 | + #license_files=[ ... ] # TODO? |
| 24 | + |
| 25 | + packages=find_namespace_packages('src/'), |
| 26 | + package_dir={"":"src/"}, |
| 27 | + |
| 28 | + # with setuptools_scm, means it includes non-python files if they're under git |
| 29 | + include_package_data=True, |
| 30 | + |
| 31 | + # with setuptools_scm, get the version out of the most recent git tag. |
| 32 | + # the tags must be formatted as semver. |
| 33 | + use_scm_version=True, |
| 34 | + |
| 35 | + # pyproject.toml::build-system.requires is supposed to supersede this, but it's still very new so we duplicate it. |
| 36 | + setup_requires=[ |
| 37 | + 'setuptools', |
| 38 | + 'setuptools_scm[toml]', |
| 39 | + 'wheel', |
| 40 | + ], |
| 41 | + |
| 42 | + zip_safe=False, # guarantees that importlib.resources.path() is safe |
| 43 | +) |
| 44 | + |
0 commit comments