-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
62 lines (50 loc) · 2.26 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
#!/usr/bin/env python
# from distutils.core import setup
# got some ideas from here: https://medium.com/@joel.barmettler/how-to-upload-your-python-package-to-pypi-65edc5fe9c56
#
# But apparently setuptools is the replacement for distutils, and distutils was causing problems such as
# not including the README.md file and not formatting it as Markdown on PyPI
# https://setuptools.readthedocs.io/en/latest/setuptools.html
from setuptools import setup
# import scadnano.scadnano_version as sv
def extract_version(filename: str):
with open(filename) as f:
lines = f.readlines()
version_comment = '# version line; WARNING: do not remove or change this line or comment'
for line in lines:
if version_comment in line:
idx = line.index(version_comment)
line_prefix = line[:idx]
parts = line_prefix.split('=')
stripped_parts = [part.strip() for part in parts]
version_str = stripped_parts[-1].replace('"', '')
return version_str
raise AssertionError(f'could not find version in {filename}')
__version__ = extract_version('scadnano/scadnano.py')
# read the contents of your README file
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(name='scadnano',
packages=['scadnano'],
version=__version__,
# version='0.8.0',
download_url=f'https://github.com/UC-Davis-molecular-computing/scadnano-python-package/archive/v{__version__}.zip',
# download_url=f'https://github.com/UC-Davis-molecular-computing/scadnano-python-package/archive/v0.7.0.zip',
license='MIT',
description="Python scripting library for generating designs readable by scadnano.",
author="David Doty",
author_email="doty@ucdavis.edu",
url="https://github.com/UC-Davis-molecular-computing/scadnano-python-package",
long_description=long_description,
long_description_content_type='text/markdown; variant=GFM',
python_requires='>=3.7',
install_requires=[
'openpyxl',
'tabulate',
],
tests_require=[
'openpyxl',
],
)