generated from sfarrens/pyralid-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
91 lines (74 loc) · 2.39 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#! /usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
# Set the package release version
major = 0
minor = 5
patch = 0
# Set the package details
name = 'sp_validation'
version = '.'.join(str(value) for value in (major, minor, patch))
author = 'Martin Kilbinger'
email = 'martin.kilbinger@cea.fr'
gh_user = 'CosmoStat'
url = 'https://github.com/{0}/{1}'.format(gh_user, name)
year = '2021'
description = (
'Validation of weak-lensing catalogues (galaxy and star shapes and other '
+ 'parameters) produced by ShapePipe'
)
license = 'MIT'
# Set the package classifiers
python_versions_supported = ['3.6', '3.7', '3.8', '3.9']
os_platforms_supported = ['Unix', 'MacOS']
lc_str = 'License :: OSI Approved :: {0} License'
ln_str = 'Programming Language :: Python'
py_str = 'Programming Language :: Python :: {0}'
os_str = 'Operating System :: {0}'
classifiers = (
[lc_str.format(license)]
+ [ln_str]
+ [py_str.format(ver) for ver in python_versions_supported]
+ [os_str.format(ops) for ops in os_platforms_supported]
)
# Source package description from README.md
this_directory = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
# Source package requirements from requirements.txt
with open('requirements.txt') as open_file:
install_requires = open_file.read()
# Source test requirements from develop.txt
with open('develop.txt') as open_file:
tests_require = open_file.read()
# Source doc requirements from docs/requirements.txt
with open('docs/requirements.txt') as open_file:
docs_require = open_file.read()
# Find scripts
def find_scripts():
sdir = 'scripts'
res = [
os.path.join(sdir, val) for val in os.listdir(sdir) if
val.endswith('.py') and '__init__' not in val
]
return res
setup(
name=name,
author=author,
author_email=email,
version=version,
license=license,
url=url,
description=description,
long_description=long_description,
long_description_content_type='text/markdown',
packages=find_packages(),
scripts=find_scripts(),
install_requires=install_requires,
python_requires='>=3.6',
setup_requires=['pytest-runner'],
tests_require=tests_require,
extras_require={'develop': tests_require + docs_require},
classifiers=classifiers,
)