|
1 | 1 | from setuptools import setup, find_packages |
2 | 2 | from os.path import join |
3 | 3 |
|
4 | | -packages = [] |
5 | | -packages_dir = {} |
| 4 | +PROJECT = 'SSD' |
| 5 | +PACKAGES = ['Core', 'SOFA'] |
6 | 6 |
|
7 | | -include_SOFA = True |
8 | | -try: |
9 | | - import Sofa |
10 | | -except ImportError: |
11 | | - include_SOFA = False |
| 7 | +packages = [f'{PROJECT}'] |
| 8 | +packages_dir = {f'{PROJECT}': 'src'} |
12 | 9 |
|
13 | | -project = 'SSD' |
14 | | -roots = ['Core', 'SOFA'] if include_SOFA else ['Core'] |
15 | | -root_packages = ['storage', 'rendering'] |
| 10 | +# Configure packages list and directories |
| 11 | +for package in find_packages(where='src'): |
| 12 | + packages.append(f'{PROJECT}.{package}') |
| 13 | +for package in PACKAGES: |
| 14 | + packages_dir[f'{PROJECT}.{package}'] = join('src', package) |
16 | 15 |
|
17 | | -for root in roots: |
18 | | - packages.append(f'{project}.{root}') |
19 | | - packages_dir[f'{project}.{root}'] = join('src', root) |
20 | | - for package in find_packages(where=join('src', root)): |
21 | | - packages.append(f'{project}.{root}.{package}') |
22 | | - packages_dir[f'{project}.{root}.{package}'] = join('src', root, package) |
| 16 | +# Add examples as subpackages |
| 17 | +examples_dir = {'Core': ['storage', 'rendering'], |
| 18 | + 'SOFA': ['storage', 'rendering', 'rendering-offscreen']} |
| 19 | +for package in PACKAGES: |
| 20 | + packages_dir[f'{PROJECT}.examples.{package}'] = join('examples', package) |
| 21 | + for example_dir in examples_dir[package]: |
| 22 | + packages.append(f'{PROJECT}.examples.{package}.{example_dir}') |
23 | 23 |
|
24 | | -examples = {'Core': ['storage', 'rendering'], |
25 | | - 'SOFA': ['storage', 'rendering', 'rendering-offscreen']} |
26 | | -for root in roots: |
27 | | - for repo in examples[root]: |
28 | | - packages.append(f'{project}.examples.{root}.{repo}') |
29 | | - packages_dir[f'{project}.examples.{root}.{repo}'] = join('examples', root, repo) |
30 | | - |
31 | | -packages.append(f'{project}') |
32 | | -packages_dir[f'{project}'] = 'src' |
| 24 | +# Extract README.md content |
| 25 | +with open('README.md') as f: |
| 26 | + long_description = f.read() |
33 | 27 |
|
| 28 | +# Installation |
34 | 29 | setup(name='SimulationSimpleDatabase', |
35 | | - version='22.06', |
| 30 | + version='22.12', |
36 | 31 | description='A simplified API to use SQL Databases with numerical simulation.', |
| 32 | + long_description=long_description, |
| 33 | + long_description_content_type='text/markdown', |
37 | 34 | author='R. Enjalbert, A. Odot', |
| 35 | + author_email='robin.enjalbert@inria.fr', |
38 | 36 | url='https://github.com/RobinEnjalbert/SimulationSimpleDatabase', |
39 | 37 | packages=packages, |
40 | 38 | package_dir=packages_dir, |
41 | | - package_data={f'{project}.examples.Core.rendering': ['armadillo.obj']}, |
| 39 | + package_data={f'{PROJECT}.examples.Core.rendering': ['armadillo.obj']}, |
42 | 40 | install_requires=['numpy', 'peewee', 'vedo'], |
43 | 41 | entry_points={'console_scripts': ['SSD=SSD.cli:execute_cli']}) |
0 commit comments