-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
43 lines (36 loc) · 1.15 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
import configparser
import setuptools
from typing import List
def read_pipfile() -> List[str]:
"""Parses package requirements from a Pipfile.
Reformats them to match a pip-style specifier, e.g. `"bs4" = "*"` -> `bs4`,
and `termcolor = ">=1.23"` -> `termcolor>=1.23`.
"""
pfile = configparser.ConfigParser()
pfile.read('Pipfile')
req_specifiers = []
for package, version in pfile['packages'].items():
# normalize strings, since Pipenv likes to add quotes on some things
package = package.strip('\'"')
version = version.strip('\'"')
spec = package + ('' if version == '*' else version)
req_specifiers.append(spec)
return req_specifiers
req_specifiers = read_pipfile()
setuptools.setup(
name='focstest',
url='https://github.com/olin/focstest/',
use_scm_version=True,
setup_requires=['setuptools_scm'],
# packages=setuptools.find_packages(),
install_requires=req_specifiers,
py_modules=['focstest'],
package_data={
'focstest': ['py.typed'],
},
entry_points={
'console_scripts': [
'focstest = focstest:main',
],
},
)