From 03a3fd72b39ce04987c8e5064da86e97871b33e0 Mon Sep 17 00:00:00 2001 From: Faerbit Date: Wed, 17 Nov 2021 13:36:03 +0100 Subject: [PATCH] Packaging --- License.md => LICENSE | 0 Pipfile | 14 -- Pipfile.lock | 201 ------------------ README.md | 22 ++ Readme.md | 7 - exceptions.py | 2 - pyproject.toml | 10 + setup.cfg | 30 +++ src/fime/__init__.py | 0 config.py => src/fime/config.py | 6 +- data.py => src/fime/data.py | 2 +- src/fime/exceptions.py | 2 + import_task.py => src/fime/import_task.py | 0 main.py => src/fime/main.py | 12 +- report.py => src/fime/report.py | 0 .../fime/task_completer.py | 0 task_edit.py => src/fime/task_edit.py | 0 util.py => src/fime/util.py | 0 18 files changed, 76 insertions(+), 232 deletions(-) rename License.md => LICENSE (100%) delete mode 100644 Pipfile delete mode 100644 Pipfile.lock create mode 100644 README.md delete mode 100644 Readme.md delete mode 100644 exceptions.py create mode 100644 pyproject.toml create mode 100644 setup.cfg create mode 100644 src/fime/__init__.py rename config.py => src/fime/config.py (84%) rename data.py => src/fime/data.py (99%) create mode 100644 src/fime/exceptions.py rename import_task.py => src/fime/import_task.py (100%) rename main.py => src/fime/main.py (97%) rename report.py => src/fime/report.py (100%) rename task_completer.py => src/fime/task_completer.py (100%) rename task_edit.py => src/fime/task_edit.py (100%) rename util.py => src/fime/util.py (100%) diff --git a/License.md b/LICENSE similarity index 100% rename from License.md rename to LICENSE diff --git a/Pipfile b/Pipfile deleted file mode 100644 index 3788417..0000000 --- a/Pipfile +++ /dev/null @@ -1,14 +0,0 @@ -[[source]] -url = "https://pypi.org/simple" -verify_ssl = true -name = "pypi" - -[packages] -requests-futures = "*" -pyside2 = "*" - -[dev-packages] -ipython = "*" - -[requires] -python_version = "3" diff --git a/Pipfile.lock b/Pipfile.lock deleted file mode 100644 index ea56280..0000000 --- a/Pipfile.lock +++ /dev/null @@ -1,201 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "3b71908cf3ecbacde9e592c855ee3b65686e920c23df69d66dd2dff2cd4afe8b" - }, - "pipfile-spec": 6, - "requires": { - "python_version": "3" - }, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.org/simple", - "verify_ssl": true - } - ] - }, - "default": { - "certifi": { - "hashes": [ - "sha256:78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872", - "sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569" - ], - "version": "==2021.10.8" - }, - "charset-normalizer": { - "hashes": [ - "sha256:e019de665e2bcf9c2b64e2e5aa025fa991da8720daa3c1138cadd2fd1856aed0", - "sha256:f7af805c321bfa1ce6714c51f254e0d5bb5e5834039bc17db7ebe3a4cec9492b" - ], - "markers": "python_version >= '3'", - "version": "==2.0.7" - }, - "idna": { - "hashes": [ - "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff", - "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d" - ], - "markers": "python_version >= '3'", - "version": "==3.3" - }, - "pyside2": { - "hashes": [ - "sha256:0558ced3bcd7f9da638fa8b7709dba5dae82a38728e481aac8b9058ea22fcdd9", - "sha256:081d8c8a6c65fb1392856a547814c0c014e25ac04b38b987d9a3483e879e9634", - "sha256:087a0b719bb967405ea85fd202757c761f1fc73d0e2397bc3a6a15376782ee75", - "sha256:1316aa22dd330df096daf7b0defe9c00297a66e0b4907f057aaa3e88c53d1aff", - "sha256:4f17a0161995678110447711d685fcd7b15b762810e8f00f6dc239bffb70a32e", - "sha256:976cacf01ef3b397a680f9228af7d3d6273b9254457ad4204731507c1f9e6c3c" - ], - "index": "pypi", - "version": "==5.15.2" - }, - "requests": { - "hashes": [ - "sha256:6c1246513ecd5ecd4528a0906f910e8f0f9c6b8ec72030dc9fd154dc1a6efd24", - "sha256:b8aa58f8cf793ffd8782d3d8cb19e66ef36f7aba4353eec859e74678b01b07a7" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4, 3.5'", - "version": "==2.26.0" - }, - "requests-futures": { - "hashes": [ - "sha256:35547502bf1958044716a03a2f47092a89efe8f9789ab0c4c528d9c9c30bc148", - "sha256:633804c773b960cef009efe2a5585483443c6eac3c39cc64beba2884013bcdd9" - ], - "index": "pypi", - "version": "==1.0.0" - }, - "shiboken2": { - "hashes": [ - "sha256:03f41b0693b91c7f89627f1085a4ecbe8591c03f904118a034854d935e0e766c", - "sha256:14a33169cf1bd919e4c4c4408fffbcd424c919a3f702df412b8d72b694e4c1d5", - "sha256:4aee1b91e339578f9831e824ce2a1ec3ba3a463f41fda8946b4547c7eb3cba86", - "sha256:89c157a0e2271909330e1655892e7039249f7b79a64a443d52c512337065cde0", - "sha256:ae8ca41274cfa057106268b6249674ca669c5b21009ec49b16d77665ab9619ed", - "sha256:edc12a4df2b5be7ca1e762ab94e331ba9e2fbfe3932c20378d8aa3f73f90e0af" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '3.10'", - "version": "==5.15.2" - }, - "urllib3": { - "hashes": [ - "sha256:4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece", - "sha256:c4fdf4019605b6e5423637e01bc9fe4daef873709a7973e195ceba0a62bbc844" - ], - "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4'", - "version": "==1.26.7" - } - }, - "develop": { - "backcall": { - "hashes": [ - "sha256:5cbdbf27be5e7cfadb448baf0aa95508f91f2bbc6c6437cd9cd06e2a4c215e1e", - "sha256:fbbce6a29f263178a1f7915c1940bde0ec2b2a967566fe1c65c1dfb7422bd255" - ], - "version": "==0.2.0" - }, - "decorator": { - "hashes": [ - "sha256:7b12e7c3c6ab203a29e157335e9122cb03de9ab7264b137594103fd4a683b374", - "sha256:e59913af105b9860aa2c8d3272d9de5a56a4e608db9a2f167a8480b323d529a7" - ], - "markers": "python_version >= '3.5'", - "version": "==5.1.0" - }, - "ipython": { - "hashes": [ - "sha256:4f69d7423a5a1972f6347ff233e38bbf4df6a150ef20fbb00c635442ac3060aa", - "sha256:a658beaf856ce46bc453366d5dc6b2ddc6c481efd3540cb28aa3943819caac9f" - ], - "index": "pypi", - "version": "==7.29.0" - }, - "jedi": { - "hashes": [ - "sha256:18456d83f65f400ab0c2d3319e48520420ef43b23a086fdc05dff34132f0fb93", - "sha256:92550a404bad8afed881a137ec9a461fed49eca661414be45059329614ed0707" - ], - "markers": "python_version >= '3.6'", - "version": "==0.18.0" - }, - "matplotlib-inline": { - "hashes": [ - "sha256:a04bfba22e0d1395479f866853ec1ee28eea1485c1d69a6faf00dc3e24ff34ee", - "sha256:aed605ba3b72462d64d475a21a9296f400a19c4f74a31b59103d2a99ffd5aa5c" - ], - "markers": "python_version >= '3.5'", - "version": "==0.1.3" - }, - "parso": { - "hashes": [ - "sha256:12b83492c6239ce32ff5eed6d3639d6a536170723c6f3f1506869f1ace413398", - "sha256:a8c4922db71e4fdb90e0d0bc6e50f9b273d3397925e5e60a717e719201778d22" - ], - "markers": "python_version >= '3.6'", - "version": "==0.8.2" - }, - "pexpect": { - "hashes": [ - "sha256:0b48a55dcb3c05f3329815901ea4fc1537514d6ba867a152b581d69ae3710937", - "sha256:fc65a43959d153d0114afe13997d439c22823a27cefceb5ff35c2178c6784c0c" - ], - "markers": "sys_platform != 'win32'", - "version": "==4.8.0" - }, - "pickleshare": { - "hashes": [ - "sha256:87683d47965c1da65cdacaf31c8441d12b8044cdec9aca500cd78fc2c683afca", - "sha256:9649af414d74d4df115d5d718f82acb59c9d418196b7b4290ed47a12ce62df56" - ], - "version": "==0.7.5" - }, - "prompt-toolkit": { - "hashes": [ - "sha256:449f333dd120bd01f5d296a8ce1452114ba3a71fae7288d2f0ae2c918764fa72", - "sha256:48d85cdca8b6c4f16480c7ce03fd193666b62b0a21667ca56b4bb5ad679d1170" - ], - "markers": "python_full_version >= '3.6.2'", - "version": "==3.0.22" - }, - "ptyprocess": { - "hashes": [ - "sha256:4b41f3967fce3af57cc7e94b888626c18bf37a083e3651ca8feeb66d492fef35", - "sha256:5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220" - ], - "version": "==0.7.0" - }, - "pygments": { - "hashes": [ - "sha256:b8e67fe6af78f492b3c4b3e2970c0624cbf08beb1e493b2c99b9fa1b67a20380", - "sha256:f398865f7eb6874156579fdf36bc840a03cab64d1cde9e93d68f46a425ec52c6" - ], - "markers": "python_version >= '3.5'", - "version": "==2.10.0" - }, - "setuptools": { - "hashes": [ - "sha256:94ee891f4759150cded601a6beb6b08400413aefd0267b692f3f8c6e0bb238e7", - "sha256:fb537610c2dfe77b5896e3ee53dd53fbdd9adc48076c8f28cee3a30fb59a5038" - ], - "markers": "python_version >= '3.6'", - "version": "==59.1.1" - }, - "traitlets": { - "hashes": [ - "sha256:059f456c5a7c1c82b98c2e8c799f39c9b8128f6d0d46941ee118daace9eb70c7", - "sha256:2d313cc50a42cd6c277e7d7dc8d4d7fedd06a2c215f78766ae7b1a66277e0033" - ], - "markers": "python_version >= '3.7'", - "version": "==5.1.1" - }, - "wcwidth": { - "hashes": [ - "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784", - "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83" - ], - "version": "==0.2.5" - } - } -} diff --git a/README.md b/README.md new file mode 100644 index 0000000..32eac8c --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# fime + +Simple time tracking app written with Python and Qt5 + +Some JIRA integration is available. + +## Config file + +The file path is OS dependant. There is an error message on the first start, which will tell you the correct path for +your OS. + +Format: +``` +jira_url = https://jira.company.com +jira_token = aBc1D34 +``` + +The `jira_token` is a Personal Access Token. See [here](https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.htmlh) on how to get one. + +## License + +Licensed under MIT license. See License.md for more details. diff --git a/Readme.md b/Readme.md deleted file mode 100644 index d562565..0000000 --- a/Readme.md +++ /dev/null @@ -1,7 +0,0 @@ -# fimefracking - -Simple time tracking app written with Python and Qt5 - -## License - -Licensed under MIT license. See License.md for more details. diff --git a/exceptions.py b/exceptions.py deleted file mode 100644 index f57fdb1..0000000 --- a/exceptions.py +++ /dev/null @@ -1,2 +0,0 @@ -class FimeFrackingException(Exception): - pass diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..93c2283 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,10 @@ +[build-system] +requires = [ + "setuptools>=45", + "wheel", + "setuptools_scm>=6.2", +] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +version_scheme = "python-simplified-semver" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..d72fd1f --- /dev/null +++ b/setup.cfg @@ -0,0 +1,30 @@ +[metadata] +name = fime +author = Faerbit +author_email = faerbit@posteo.net +description = Simple time tracking app written with Python and Qt5 +long_description = file: README.md +long_description_content_type = text/markdown +url = https://git.faerb.it/faerbit/fime +classifiers = + Programming Language :: Python :: 3 + License :: OSI Approved :: MIT License + Operating System :: OS Independent + +[options] +package_dir = + = src +packages = find: +python_requires = >=3.6 +install_requires = + requests + requests-futures + PySide2 + +[options.packages.find] +where = src + +[options.entry_points] +console_scripts = + fime = fime.main:main + diff --git a/src/fime/__init__.py b/src/fime/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/config.py b/src/fime/config.py similarity index 84% rename from config.py rename to src/fime/config.py index 79254db..fd55eeb 100644 --- a/config.py +++ b/src/fime/config.py @@ -4,7 +4,7 @@ from pathlib import Path from PySide2 import QtCore -from exceptions import FimeFrackingException +from exceptions import FimeException def dequotify(string): @@ -18,7 +18,7 @@ class Config: def __init__(self): self._configparser = ConfigParser() config_dir_path = Path(QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.ConfigLocation)) - config_path = config_dir_path / "fimefracking" / "fimefracking.conf" + config_path = config_dir_path / "fime" / "fime.conf" if config_path.exists(): with open(config_path) as f: config_text = f.read() @@ -26,7 +26,7 @@ class Config: self._configparser.read_string(config_text) if (not self._configparser.has_option("DEFAULT", "jira_url") or not self._configparser.has_option("DEFAULT", "jira_token")): - raise FimeFrackingException(f'Please add config file {config_path} ' + raise FimeException(f'Please add config file {config_path} ' f'with config keys "jira_url" and "jira_token" in INI style') @property diff --git a/data.py b/src/fime/data.py similarity index 99% rename from data.py rename to src/fime/data.py index b3a3c88..6854454 100644 --- a/data.py +++ b/src/fime/data.py @@ -10,7 +10,7 @@ from typing import List from PySide2 import QtCore data_dir_path = os.path.join(QtCore.QStandardPaths.writableLocation(QtCore.QStandardPaths.AppDataLocation), - "fimefracking") + "fime") tasks_path = os.path.join(data_dir_path, "tasks.json") diff --git a/src/fime/exceptions.py b/src/fime/exceptions.py new file mode 100644 index 0000000..1ccf621 --- /dev/null +++ b/src/fime/exceptions.py @@ -0,0 +1,2 @@ +class FimeException(Exception): + pass diff --git a/import_task.py b/src/fime/import_task.py similarity index 100% rename from import_task.py rename to src/fime/import_task.py diff --git a/main.py b/src/fime/main.py similarity index 97% rename from main.py rename to src/fime/main.py index b466196..df64b09 100755 --- a/main.py +++ b/src/fime/main.py @@ -8,7 +8,7 @@ from PySide2 import QtCore, QtGui, QtWidgets from PySide2.QtWidgets import QMessageBox from data import Tasks, Log, Data -from exceptions import FimeFrackingException +from exceptions import FimeException from import_task import ImportTask from task_edit import TaskEdit from report import Report @@ -41,7 +41,7 @@ class App: self.tray.setIcon(icon) self.tray.setContextMenu(self.menu) self.tray.show() - self.tray.setToolTip("fimefracking") + self.tray.setToolTip("fime") self.update_tray_menu() @QtCore.Slot() @@ -143,9 +143,13 @@ class App: self.taskEdit.show() -if __name__ == "__main__": +def main(): try: app = App() app.run() - except FimeFrackingException as e: + except FimeException as e: QMessageBox.critical(None, "Error", str(e), QMessageBox.Ok) + + +if __name__ == "__main__": + main() diff --git a/report.py b/src/fime/report.py similarity index 100% rename from report.py rename to src/fime/report.py diff --git a/task_completer.py b/src/fime/task_completer.py similarity index 100% rename from task_completer.py rename to src/fime/task_completer.py diff --git a/task_edit.py b/src/fime/task_edit.py similarity index 100% rename from task_edit.py rename to src/fime/task_edit.py diff --git a/util.py b/src/fime/util.py similarity index 100% rename from util.py rename to src/fime/util.py