Skip to content

Commit 602c8fe

Browse files
Merge pull request #49 from AndreWohnsland/dev
Add time off reason
2 parents 2a3d1e0 + 0661fc7 commit 602c8fe

32 files changed

Lines changed: 2065 additions & 926 deletions

.github/workflows/build_release.yml

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,37 +18,32 @@ jobs:
1818
artifact_name: timetracker_win.exe
1919
- os: macos-latest
2020
artifact_name: timetracker_mac
21+
env:
22+
PYI_NAME: ${{ matrix.artifact_name }}
2123

2224
steps:
23-
- name: Checkout code
24-
uses: actions/checkout@v4
25-
26-
- name: Install the latest version of uv
27-
uses: astral-sh/setup-uv@v6
28-
29-
- name: Install dependencies
30-
run: uv sync --all-extras
31-
32-
- name: Build
33-
run: >
34-
uv run pyinstaller
35-
--onefile
36-
-w
37-
--name ${{ matrix.artifact_name }}
38-
--icon="ui/clock.png"
39-
--hidden-import="holidays.countries"
40-
runme.py
41-
42-
- name: Upload artifact
43-
uses: actions/upload-artifact@v4
44-
with:
45-
name: ${{ matrix.artifact_name }}
46-
path: dist/${{ matrix.artifact_name }}
47-
48-
- name: Upload binaries to release
49-
uses: svenstaro/upload-release-action@v2
50-
with:
51-
repo_token: ${{ secrets.GITHUB_TOKEN }}
52-
file: dist/${{ matrix.artifact_name }}
53-
asset_name: ${{ matrix.artifact_name }}
54-
tag: ${{ github.event.release.tag_name }}
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Install the latest version of uv
29+
uses: astral-sh/setup-uv@v6
30+
31+
- name: Install dependencies
32+
run: uv sync --all-extras
33+
34+
- name: Build with PyInstaller
35+
run: uv run pyinstaller installer.spec
36+
37+
- name: Upload artifact
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: ${{ matrix.artifact_name }}
41+
path: dist/${{ matrix.artifact_name }}
42+
43+
- name: Upload binaries to release
44+
uses: svenstaro/upload-release-action@v2
45+
with:
46+
repo_token: ${{ secrets.GITHUB_TOKEN }}
47+
file: dist/${{ matrix.artifact_name }}
48+
asset_name: ${{ matrix.artifact_name }}
49+
tag: ${{ github.event.release.tag_name }}

.github/workflows/linting.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
1-
name: Linting
1+
name: Code Quality Checks
22
on: [pull_request]
33
jobs:
44
ruff:
55
runs-on: ubuntu-latest
66
steps:
7-
- uses: actions/checkout@v4
8-
- name: Check that code is conformant with ruff
7+
- name: ⤵️ Check out code from GitHub
8+
uses: actions/checkout@v5
9+
- name: 🔍 Check that code is conformant with ruff
910
uses: astral-sh/ruff-action@v3
1011
with:
11-
src: './src'
12+
src: "./src"
1213
mypy:
1314
runs-on: ubuntu-latest
1415
steps:
15-
- uses: actions/checkout@v4
16+
- name: ⤵️ Check out code from GitHub
17+
uses: actions/checkout@v5
1618
- name: Install the latest version of uv
17-
uses: astral-sh/setup-uv@v6
18-
- name: Lint with mypy
19-
run: uv run mypy src
19+
uses: astral-sh/setup-uv@v7
20+
- name: 🔍 Lint with mypy
21+
run: uv run mypy src
22+
23+
pytest:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: ⤵️ Check out code from GitHub
27+
uses: actions/checkout@v5
28+
- name: Install the latest version of uv
29+
uses: astral-sh/setup-uv@v7
30+
- name: 🔍 Run tests with pytest
31+
run: uv run pytest tests

.github/workflows/manual_build.yml

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,28 +17,35 @@ jobs:
1717
- os: macos-latest
1818
artifact_name: timetracker_latest_mac
1919

20+
env:
21+
PYI_NAME: ${{ matrix.artifact_name }}
22+
UPLOAD_PATH: dist/${{ matrix.artifact_name }}
23+
2024
steps:
21-
- name: Checkout code
22-
uses: actions/checkout@v4
23-
24-
- name: Install the latest version of uv
25-
uses: astral-sh/setup-uv@v6
26-
27-
- name: Install dependencies
28-
run: uv sync --all-extras
29-
30-
- name: Build
31-
run: >
32-
uv run pyinstaller
33-
--onefile
34-
-w
35-
--name ${{ matrix.artifact_name }}
36-
--icon="ui/clock.png"
37-
--hidden-import="holidays.countries"
38-
runme.py
39-
40-
- name: Upload artifact
41-
uses: actions/upload-artifact@v4
42-
with:
43-
name: ${{ matrix.artifact_name }}
44-
path: dist/${{ matrix.artifact_name }}
25+
- name: Checkout code
26+
uses: actions/checkout@v4
27+
28+
- name: Install the latest version of uv
29+
uses: astral-sh/setup-uv@v6
30+
31+
- name: Install dependencies
32+
run: uv sync --all-extras
33+
34+
- name: Build with PyInstaller
35+
run: uv run pyinstaller installer.spec
36+
37+
- name: Bundle macOS outputs
38+
if: matrix.os == 'macos-latest'
39+
run: |
40+
cd dist
41+
zip -r "${{ matrix.artifact_name }}.zip" "${{ matrix.artifact_name }}" "${{ matrix.artifact_name }}.app"
42+
echo "UPLOAD_PATH=$(pwd)/${{ matrix.artifact_name }}.zip" >> $GITHUB_ENV
43+
44+
- name: "Debug: List dist directory"
45+
run: ls dist/
46+
47+
- name: Upload artifact
48+
uses: actions/upload-artifact@v4
49+
with:
50+
name: ${{ matrix.artifact_name }}
51+
path: ${{ env.UPLOAD_PATH }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ MANIFEST
3131
# before PyInstaller builds the exe, so as to inject date/other infos into it.
3232
*.manifest
3333
*.spec
34+
!installer.spec
3435

3536
# Installer logs
3637
pip-log.txt

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ This is currently still experimental, but you can try either the manual installa
3939

4040
### B: Manual Installation
4141

42-
This application needs at least Python 3.11 installed at the system as well as the required packages.
42+
We use [uv](https://docs.astral.sh/uv/getting-started/installation/) for managing Python versions.
43+
If you don't want to use uv, you can also use your system Python and pip to install the required packages.
4344
First clone the repository and cd into it.
4445
The required package can be installed with pip or uv.
4546
To start the app, you run the `runme.py` file with python, you can create a shortcut on your desktop:
@@ -54,6 +55,19 @@ pip install -r requirements.txt
5455
python runme.py
5556
```
5657

58+
### Manual build of the standalone version
59+
60+
If you want to build the standalone version by yourself, you can also do it with [uv](https://docs.astral.sh/uv/getting-started/installation/).
61+
Especially on windows and macOS, because on these systems, they will probably complain that the downloaded binary is not trusted.
62+
First, make sure you have uv installed and clone the repository.
63+
Then run the following commands to create the standalone version:
64+
65+
```bash
66+
uv run pyinstaller installer.spec
67+
```
68+
69+
The created binary will be in the `dist` folder.
70+
5771
## Options
5872

5973
On first startup, the application will create the needed configuration and the database.

alembic.ini

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
# A generic, single database configuration.
2+
3+
[alembic]
4+
# path to migration scripts.
5+
# this is typically a path given in POSIX (e.g. forward slashes)
6+
# format, relative to the token %(here)s which refers to the location of this
7+
# ini file
8+
script_location = %(here)s/alembic
9+
10+
# template used to generate migration file names; The default value is %%(rev)s_%%(slug)s
11+
# Uncomment the line below if you want the files to be prepended with date and time
12+
# see https://alembic.sqlalchemy.org/en/latest/tutorial.html#editing-the-ini-file
13+
# for all available tokens
14+
# file_template = %%(year)d_%%(month).2d_%%(day).2d_%%(hour).2d%%(minute).2d-%%(rev)s_%%(slug)s
15+
16+
# sys.path path, will be prepended to sys.path if present.
17+
# defaults to the current working directory. for multiple paths, the path separator
18+
# is defined by "path_separator" below.
19+
prepend_sys_path = .
20+
21+
22+
# timezone to use when rendering the date within the migration file
23+
# as well as the filename.
24+
# If specified, requires the tzdata library which can be installed by adding
25+
# `alembic[tz]` to the pip requirements.
26+
# string value is passed to ZoneInfo()
27+
# leave blank for localtime
28+
# timezone =
29+
30+
# max length of characters to apply to the "slug" field
31+
# truncate_slug_length = 40
32+
33+
# set to 'true' to run the environment during
34+
# the 'revision' command, regardless of autogenerate
35+
# revision_environment = false
36+
37+
# set to 'true' to allow .pyc and .pyo files without
38+
# a source .py file to be detected as revisions in the
39+
# versions/ directory
40+
# sourceless = false
41+
42+
# version location specification; This defaults
43+
# to <script_location>/versions. When using multiple version
44+
# directories, initial revisions must be specified with --version-path.
45+
# The path separator used here should be the separator specified by "path_separator"
46+
# below.
47+
# version_locations = %(here)s/bar:%(here)s/bat:%(here)s/alembic/versions
48+
49+
# path_separator; This indicates what character is used to split lists of file
50+
# paths, including version_locations and prepend_sys_path within configparser
51+
# files such as alembic.ini.
52+
# The default rendered in new alembic.ini files is "os", which uses os.pathsep
53+
# to provide os-dependent path splitting.
54+
#
55+
# Note that in order to support legacy alembic.ini files, this default does NOT
56+
# take place if path_separator is not present in alembic.ini. If this
57+
# option is omitted entirely, fallback logic is as follows:
58+
#
59+
# 1. Parsing of the version_locations option falls back to using the legacy
60+
# "version_path_separator" key, which if absent then falls back to the legacy
61+
# behavior of splitting on spaces and/or commas.
62+
# 2. Parsing of the prepend_sys_path option falls back to the legacy
63+
# behavior of splitting on spaces, commas, or colons.
64+
#
65+
# Valid values for path_separator are:
66+
#
67+
# path_separator = :
68+
# path_separator = ;
69+
# path_separator = space
70+
# path_separator = newline
71+
#
72+
# Use os.pathsep. Default configuration used for new projects.
73+
path_separator = os
74+
75+
# set to 'true' to search source files recursively
76+
# in each "version_locations" directory
77+
# new in Alembic version 1.10
78+
# recursive_version_locations = false
79+
80+
# the output encoding used when revision files
81+
# are written from script.py.mako
82+
# output_encoding = utf-8
83+
84+
# database URL. This is consumed by the user-maintained env.py script only.
85+
# other means of configuring database URLs may be customized within the env.py
86+
# file.
87+
sqlalchemy.url = sqlite:///
88+
89+
90+
[post_write_hooks]
91+
# post_write_hooks defines scripts or Python functions that are run
92+
# on newly generated revision scripts. See the documentation for further
93+
# detail and examples
94+
95+
# format using "black" - use the console_scripts runner, against the "black" entrypoint
96+
# hooks = black
97+
# black.type = console_scripts
98+
# black.entrypoint = black
99+
# black.options = -l 79 REVISION_SCRIPT_FILENAME
100+
101+
# lint with attempts to fix using "ruff" - use the module runner, against the "ruff" module
102+
# hooks = ruff
103+
# ruff.type = module
104+
# ruff.module = ruff
105+
# ruff.options = check --fix REVISION_SCRIPT_FILENAME
106+
107+
# Alternatively, use the exec runner to execute a binary found on your PATH
108+
# hooks = ruff
109+
# ruff.type = exec
110+
# ruff.executable = ruff
111+
# ruff.options = check --fix REVISION_SCRIPT_FILENAME
112+
113+
# Logging configuration. This is also consumed by the user-maintained
114+
# env.py script only.
115+
[loggers]
116+
keys = root,sqlalchemy,alembic
117+
118+
[handlers]
119+
keys = console
120+
121+
[formatters]
122+
keys = generic
123+
124+
[logger_root]
125+
level = WARNING
126+
handlers = console
127+
qualname =
128+
129+
[logger_sqlalchemy]
130+
level = WARNING
131+
handlers =
132+
qualname = sqlalchemy.engine
133+
134+
[logger_alembic]
135+
level = INFO
136+
handlers =
137+
qualname = alembic
138+
139+
[handler_console]
140+
class = StreamHandler
141+
args = (sys.stderr,)
142+
level = NOTSET
143+
formatter = generic
144+
145+
[formatter_generic]
146+
format = %(levelname)-5.5s [%(name)s] %(message)s
147+
datefmt = %H:%M:%S

0 commit comments

Comments
 (0)