forked from jprouty/mint-amazon-tagger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
109 lines (95 loc) · 2.96 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
103
104
105
106
107
108
109
import setuptools
from outdated import check_outdated
from mintamazontagger import VERSION
from distutils.errors import DistutilsError
with open("README.md", "r") as fh:
long_description = fh.read()
class CleanCommand(setuptools.Command):
"""Custom clean command to tidy up the project root."""
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import shutil
dirs = [
'build',
'dist',
'tagger-release',
'target',
'release_venv',
'cache',
'mint_amazon_tagger.egg-info',
]
for tree in dirs:
shutil.rmtree(tree, ignore_errors=True)
import os
from glob import glob
globs = ('**/*.pyc', '**/*.tgz', '**/*.pyo')
for g in globs:
for file in glob(g, recursive=True):
try:
os.remove(file)
except OSError:
print(f"Error while deleting file: {file}")
class BlockReleaseCommand(setuptools.Command):
"""Raises an error if VERSION is already present on PyPI."""
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
try:
stale, latest = check_outdated('mint-amazon-tagger', VERSION)
raise DistutilsError(
'Please update VERSION in __init__. '
f'Current {VERSION} PyPI latest {latest}')
except ValueError:
pass
setuptools.setup(
name="mint-amazon-tagger",
version=VERSION,
author="Jeff Prouty",
author_email="[email protected]",
description=("Fetches your Amazon order history and matching/tags your "
"Mint transactions"),
keywords='amazon mint tagger transactions order history',
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/jprouty/mint-amazon-tagger",
packages=setuptools.find_packages(),
python_requires='>=3',
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Topic :: Office/Business :: Financial",
],
install_requires=[
'PyQt5',
'mintapi',
'mock',
'oathtool',
'outdated',
'psutil',
'progress',
'range-key-dict',
'requests',
'readchar',
'selenium',
'selenium-requests>=2.0.3',
],
entry_points=dict(
console_scripts=[
'mint-amazon-tagger-cli=mintamazontagger.cli:main',
'mint-amazon-tagger=mintamazontagger.main:main',
'mint-amazon-tagger-repro_selenium_issue=mintamazontagger.repro_mac_issue:main'
],
),
cmdclass={
'clean': CleanCommand,
'block_on_version': BlockReleaseCommand,
},
)