-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.py
96 lines (90 loc) · 4.22 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
92
93
94
95
96
import os
from setuptools import setup
#from Organisms import __version__
#def get_version_number():
# version = __version__
# return version
def get_version_number():
path_to_written_version = 'Organisms/__init__.py'
with open(path_to_written_version) as initPY:
for line in initPY:
if line.startswith('__version__'):
version = eval(line.rstrip().replace('__version__ = ',''))
break
return version
def get_long_description():
this_directory = os.path.abspath(os.path.dirname(__file__))
readme_file = os.path.join(this_directory, 'README.md')
with open(readme_file, encoding='utf-8') as f:
long_description = f.read()
return long_description
def find_packages(root):
packages = []
for root, dirs, files in os.walk(root, topdown=False):
for name in files:
if name.endswith('.py'):
file = os.path.relpath(os.path.join(root, name))
dirname = os.path.dirname(file)
rel_dirname = os.path.relpath(dirname)
if not rel_dirname in packages:
packages.append(rel_dirname)
return sorted(packages)
def find_scripts():
scripts = []
scripts_folders = ['Subsidiary_Programs','Postprocessing_Programs','Helpful_Programs']
for scripts_folder in scripts_folders:
for root, dirs, files in os.walk('Organisms/'+scripts_folder, topdown=False):
for file in files:
if file.endswith('.py') and not 'Main' in file:
filepath = os.path.relpath(os.path.join(root, file))
scripts.append(filepath)
dirs[:] = []
'''
for index in range(len(dirs)-1,-1,-1):
directory = dirs[index]
if not 'Main' in directory:
del dirs[index]
'''
return sorted(scripts)
setup(name='Organisms',
packages=find_packages(root='Organisms'),
scripts=find_scripts(),
version=get_version_number(),
description="This program is designed to perform a genetic algorithm global optimisation for nanoclusters.",
long_description=get_long_description(),
long_description_content_type='text/markdown',
author='Dr. Geoffrey R. Weal and Dr. Anna L. Garden',
author_email='[email protected]',
url = 'https://blogs.otago.ac.nz/annagarden/',
download_url = 'https://github.com/GardenGroupUO/Organisms/archive/v'+str(get_version_number())+'.tar.gz',
license='GNU AFFERO GENERAL PUBLIC LICENSE',
zip_safe=False,
keywords = ['nanoclusters', 'nanoparticles', 'clusters', 'optimisation', 'genetic-algorithm', 'ase', 'university-of-otago', 'asap3', 'atomic-simulation-environment', 'predation-operator', 'fitness-operator', 'otago-university', 'common-neighbor-analysis', 'common-neighbour-analysis', 'jupyter', 'Colabs', 'Google Golabs'],
install_requires=[
'numpy','scipy','ase','asap3','packaging','termcolor','tqdm'
#'Sphinx','sphinx-rtd-theme','sphinx-tabs','sphinxcontrib-applehelp','sphinxcontrib-devhelp',
#'sphinxcontrib-htmlhelp','sphinxcontrib-jsmath','sphinxcontrib-plantuml','sphinxcontrib-qthelp',
#'sphinxcontrib-serializinghtml','sphinxcontrib-wiki',
],
classifiers=[
'Development Status :: 3 - Alpha', # Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package
'Intended Audience :: Science/Research', # Define that your audience are developers
'Natural Language :: English',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
'Operating System :: Unix',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Scientific/Engineering :: Physics',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Natural Language :: English',
'License :: OSI Approved :: GNU Affero General Public License v3', # Again, pick a license
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
],
)