-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
65 lines (56 loc) · 1.88 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2020-2021 Fabrice Laporte - kray.me
# The MIT License http://www.opensource.org/licenses/mit-license.php
import codecs
import os
import re
from setuptools import setup
PKG_NAME = "treeage"
DIRPATH = os.path.dirname(__file__)
def read_rsrc(filename, pypi_compat=False):
"""Return content of filename.
If pypi_compat is True, remove emojis and anything preceding
`.. pypi` comment if present.
"""
with codecs.open(os.path.join(DIRPATH, filename), encoding="utf-8") as _file:
data = _file.read().strip()
if pypi_compat or filename == "README.rst":
data = re.sub(r":(\w+\\?)+:", "", data[data.find(".. pypi") :] or data)
return data
with codecs.open("{}/__init__.py".format(PKG_NAME), encoding="utf-8") as fd:
version = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE
).group(1)
# Deploy: python3 setup.py sdist bdist_wheel; twine upload --verbose dist/*
setup(
name=PKG_NAME,
version=version,
description="Lists contents of directories in a tree-like format with age metric indicated for each file",
long_description=read_rsrc("README.rst"),
author="Fabrice Laporte",
url="https://github.com/KraYmer/treeage",
license="MIT",
platforms="ALL",
packages=[
"treeage",
],
entry_points={"console_scripts": ["treeage = treeage:treeage_cli"]},
install_requires=read_rsrc("requirements.txt").split("\n"),
python_requires=">=3.6",
extras_require={
"test": [
"coverage>5",
"pytest>=6",
"tox>=3",
]
},
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Environment :: Console",
"Topic :: System :: Filesystems",
],
keywords="git",
)