-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
102 lines (88 loc) · 3.42 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
97
98
99
100
101
102
#!/usr/bin/python3
# -*- coding: UTF-8 -*-
'''
The build version is auto update by local git hook at .git/hooks/pre-push with the following content
#!/bin/bash
build=$(printf '0x%x' $(date +%s))
meta=$(cat filecrawler/__meta__.py | sed "s/__build__.*/__build__ = "${build}"/")
echo "$meta" > filecrawler/__meta__.py
git add ./filecrawler/__meta__.py
git commit -m "Update build version"
'''
import os
import sys
from setuptools import setup, find_packages
meta = {}
here = os.path.abspath(os.path.dirname(__file__))
with open(f"{here}/filecrawler/__meta__.py") as f:
exec(f.read(), meta)
with open(f"{here}/requirements.txt", "r", encoding="utf-8") as f:
requires = f.read().splitlines()
if not requires:
print("Unable to read requirements from the requirements.txt file"
"That indicates this copy of the source code is incomplete.")
sys.exit(2)
with open(f"{here}/README.md", "r", encoding="utf-8") as f:
readme = f.read()
# Find package Data
# each directory must contain __init__.py
package_data = {"": ["LICENSE"]}
package_data.update(
{
dp.replace(here.strip('/') + '/', '').lstrip('/. ').replace('\\', '/').replace('/', '.'): [
f for f in filenames if '.py' not in f.lower() and '.ds_store' not in f.lower()
]
for dp, dn, filenames in os.walk(f"{here}/filecrawler") for f in filenames
if '.py' not in f.lower() and '.ds_store' not in f.lower()
}
)
#If you use both include_package_data and package_data, files specified with package_data will not be automatically included in sdists; you must instead list them in your MANIFEST.in
setup(
name=meta["__title__"],
version=meta["__version__"],
description=meta["__description__"],
long_description=readme,
long_description_content_type="text/markdown",
author=meta["__author__"],
author_email=meta["__author_email__"],
url=meta["__url__"],
packages=find_packages(),
package_data=package_data,
data_files=[('', ['requirements.txt'])],
#include_package_data=True,
python_requires=">=3.8, <4",
install_requires=requires,
license=meta["__license__"],
readme="README.md",
zip_safe=False,
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Security",
"Topic :: System :: Networking",
"Topic :: System :: Operating System",
"Topic :: System :: Systems Administration",
"Topic :: Utilities"
],
entry_points={'console_scripts': [
'filecrawler=filecrawler.filecrawler:run',
]
},
project_urls={
"Main Author": "https://sec4us.com.br/instrutores/helvio-junior/",
"Documentation": "https://github.com/helviojunior/filecrawler",
"Source": "https://github.com/helviojunior/filecrawler",
},
)