-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsetup.py
76 lines (62 loc) · 2.21 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
# -*- coding: utf-8 -*-
# Copyright (c) 2021 The Project GNOME Pomodoro Tracking Authors
import sys
import os
from shutil import rmtree
from setuptools import setup, Command, find_packages
class PublishCommand(Command):
user_options = [("testpypi", "t", "Publish on https://test.pypi.org/")]
def initialize_options(self):
self.testpypi = 0
def finalize_options(self):
pass
def run(self):
try:
print("Removing previous builds ...")
rmtree("./dist")
except OSError:
pass
print("Building Source and Wheel (universal) distribution…")
os.system("{0} setup.py sdist bdist_wheel --universal".format(sys.executable))
print("Uploading the package to PyPi via Twine…")
if self.testpypi:
os.system("twine upload --repository testpypi dist/*")
else:
os.system("twine upload dist/*")
long_description = ""
with open("README.md", encoding="utf-8") as f:
long_description = f.read()
requirements = []
with open("requirements.txt", encoding="utf-8") as f:
for line in f.readlines():
requirements.append(line.replace("\n", ""))
setup(
name="gnome-pomodoro-tracking",
version="4.1.2",
url="https://github.com/gnome-pomodoro/gnome-pomodoro-tracking",
author="Jose Hbez",
author_email="josehbez@outlook.com",
description="Connect your Pomodoros to popular time tracking services.",
long_description=long_description,
long_description_content_type="text/markdown",
packages=find_packages(exclude=["docs", "tests*"]),
include_package_data=True,
entry_points={
"console_scripts": [
"gnome-pomodoro-tracking=gnome_pomodoro_tracking.__main__:main"
]
},
install_requires=requirements,
license="MIT",
classifiers=[
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3",
"Topic :: Utilities",
],
cmdclass={"publish": PublishCommand},
)