-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
53 lines (44 loc) · 2.11 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
import os
import setuptools
def find_package_files(directory, remove_root):
"""
Walk the filesystem from the specifed directory to get a recursive list of files. Remove the start of each
if it matches the specified removal string to leave paths relative to their containing package
:param directory: Path to the folder to walk
:param remove_root: Remove this if it appears at the start of a file path
:return: A list of file paths relative to a package folder
"""
file_paths = []
for (path, directories, filenames) in os.walk(directory):
# Remove the start of the path to leave the path relative to the package folder
if path.startswith(remove_root):
path = path[len(remove_root):]
for filename in filenames:
file_paths.append(os.path.join(path, filename))
return file_paths
# The package data for the web package includes the whole directory tree for the static files plus
# the Flask view templates
naturerec_web_package_data = find_package_files("src/naturerec_web/static", "src/naturerec_web/")
naturerec_web_package_data.append("templates/*.html")
setuptools.setup(
name="nature_recorder",
version="1.10.0",
description="Wildlife sightings database",
packages=setuptools.find_packages("src"),
include_package_data=True,
package_dir={"": "src"},
package_data={
"naturerec_web": naturerec_web_package_data,
"naturerec_web.auth": ["templates/auth/*.html"],
"naturerec_web.categories": ["templates/categories/*.html"],
"naturerec_web.export": ["templates/export/*.html"],
"naturerec_web.jobs": ["templates/jobs/*.html"],
"naturerec_web.life_list": ["templates/life_list/*.html"],
"naturerec_web.locations": ["templates/locations/*.html"],
"naturerec_web.reports": ["templates/reports/*.html"],
"naturerec_web.sightings": ["templates/sightings/*.html"],
"naturerec_web.species": ["templates/species/*.html"],
"naturerec_web.species_ratings": ["templates/species_ratings/*.html"],
"naturerec_web.status": ["templates/status/*.html"],
}
)