gnome-night-shift 0.4.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. gnome_night_shift-0.4.5/.github/workflows/publish-pypi.yml +118 -0
  2. gnome_night_shift-0.4.5/.github/workflows/publish-testpypi.yml +79 -0
  3. gnome_night_shift-0.4.5/.github/workflows/test.yml +43 -0
  4. gnome_night_shift-0.4.5/.gitignore +221 -0
  5. gnome_night_shift-0.4.5/LICENSE +674 -0
  6. gnome_night_shift-0.4.5/Makefile +64 -0
  7. gnome_night_shift-0.4.5/PKG-INFO +53 -0
  8. gnome_night_shift-0.4.5/README.md +28 -0
  9. gnome_night_shift-0.4.5/pyproject.toml +52 -0
  10. gnome_night_shift-0.4.5/pytest.ini +5 -0
  11. gnome_night_shift-0.4.5/setup.cfg +4 -0
  12. gnome_night_shift-0.4.5/src/gnome_night_shift.egg-info/PKG-INFO +53 -0
  13. gnome_night_shift-0.4.5/src/gnome_night_shift.egg-info/SOURCES.txt +28 -0
  14. gnome_night_shift-0.4.5/src/gnome_night_shift.egg-info/dependency_links.txt +1 -0
  15. gnome_night_shift-0.4.5/src/gnome_night_shift.egg-info/entry_points.txt +2 -0
  16. gnome_night_shift-0.4.5/src/gnome_night_shift.egg-info/requires.txt +9 -0
  17. gnome_night_shift-0.4.5/src/gnome_night_shift.egg-info/scm_file_list.json +24 -0
  18. gnome_night_shift-0.4.5/src/gnome_night_shift.egg-info/scm_version.json +8 -0
  19. gnome_night_shift-0.4.5/src/gnome_night_shift.egg-info/top_level.txt +1 -0
  20. gnome_night_shift-0.4.5/src/night_shift_services/__init__.py +29 -0
  21. gnome_night_shift-0.4.5/src/night_shift_services/cli.py +85 -0
  22. gnome_night_shift-0.4.5/src/night_shift_services/services.py +217 -0
  23. gnome_night_shift-0.4.5/src/night_shift_services/systemd/user/get-sunrise-sunset.service +11 -0
  24. gnome_night_shift-0.4.5/src/night_shift_services/systemd/user/get-sunrise-sunset.timer +12 -0
  25. gnome_night_shift-0.4.5/src/night_shift_services/systemd/user/night-shift.service +10 -0
  26. gnome_night_shift-0.4.5/src/night_shift_services/systemd/user/night-shift.timer +11 -0
  27. gnome_night_shift-0.4.5/tests/conftest.py +37 -0
  28. gnome_night_shift-0.4.5/tests/test_service.py +357 -0
  29. gnome_night_shift-0.4.5/tests/test_services_cli.py +47 -0
  30. gnome_night_shift-0.4.5/tests/test_units.py +81 -0
@@ -0,0 +1,118 @@
1
+ name: Publish to PyPI
2
+
3
+ # Run by hand: Actions tab -> "Publish to PyPI" -> Run workflow, on a commit
4
+ # tagged gnome-vX.Y.Z (gnome-night-shift)
5
+ # Uploads to PyPI are permanent, so:
6
+ # - only release versions are uploaded (no .devN / a / b / rc builds), and
7
+ # - the publish jobs use the `pypi` environment; give it required reviewers
8
+ # (Settings -> Environments) so every upload waits for your approval.
9
+ # Logs in with PyPI Trusted Publishing: add a pending publisher on pypi.org for
10
+ # gnome-night-shift with repository christophermca/gnome-night-shift, workflow
11
+ # `publish-pypi.yml` and environment `pypi`.
12
+
13
+ on:
14
+ workflow_dispatch:
15
+
16
+ jobs:
17
+ test:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@v7
21
+ with:
22
+ fetch-depth: 0
23
+
24
+ - uses: actions/setup-python@v7
25
+ with:
26
+ python-version: "3.12"
27
+ cache: pip
28
+
29
+ # PyGObject builds from source on the runner; it needs these headers.
30
+ # libglib2.0-bin provides glib-compile-schemas for the schema tests.
31
+
32
+ - name: Install system libraries
33
+ run: |
34
+ sudo apt-get update
35
+ sudo apt-get install -y libgirepository-2.0-dev libcairo2-dev pkg-config libglib2.0-bin
36
+
37
+ - name: Install dependencies
38
+ run: |
39
+ python -m pip install --upgrade pip
40
+ python -m pip install -e ".[test]"
41
+
42
+ - name: Run tests
43
+ run: python -m pytest
44
+
45
+ build:
46
+ needs: test
47
+ runs-on: ubuntu-latest
48
+ steps:
49
+ - uses: actions/checkout@v7
50
+ with:
51
+ fetch-depth: 0
52
+
53
+ - uses: actions/setup-python@v7
54
+ with:
55
+ python-version: "3.12"
56
+ cache: pip
57
+
58
+ - name: Install system libraries
59
+ run: |
60
+ sudo apt-get update
61
+ sudo apt-get install -y libgirepository-2.0-dev libcairo2-dev pkg-config libglib2.0-bin
62
+
63
+ - name: Build
64
+ run: |
65
+ python -m pip install --upgrade pip build twine
66
+ python -m build . --outdir dist/core # nocturne-shift
67
+ python -m twine check --strict dist/*/*
68
+
69
+ # Install the freshly built wheel the way a user would, so a broken
70
+ # package or dependency fails here, not after the upload.
71
+ #
72
+ # Untagged commits build dev versions (0.4.4.dev3), which pip skips by
73
+ # default. Instead of --pre (pre-releases for *every* package, requests
74
+ # included), pin nocturne-shift to the exact version just built: a
75
+ # pin that names a pre-release allows it for that package only.
76
+ - name: Smoke-test the built wheels
77
+ run: |
78
+ for wheel in dist/*/*.whl; do
79
+ file=$(basename "$wheel") # nocturne_shift-0.4.4.dev3-py3-none-any.whl
80
+ name=${file%%-*} # nocturne_shift
81
+ version=${file#*-}; version=${version%%-*} # 0.4.4.dev3
82
+ echo "${name//_/-}==${version}"
83
+ done > /tmp/constraints.txt
84
+ cat /tmp/constraints.txt
85
+ python -m venv /tmp/smoke
86
+ /tmp/smoke/bin/pip install --constraint /tmp/constraints.txt \
87
+ --find-links dist/core nocturne-shift
88
+ /tmp/smoke/bin/nocturne-shift --version
89
+
90
+ # PyPI is permanent: only upload versions built from a release tag.
91
+ - name: Refuse dev / pre-release builds
92
+ run: |
93
+ if ls dist/core/*.whl | grep -E "\.dev[0-9]+|a[0-9]+-|b[0-9]+-|rc[0-9]+-"; then
94
+ echo "::error::Not a release build. Tag the commit (cli-vX.Y.Z) and run from it."
95
+ exit 1
96
+ fi
97
+ echo "Release versions only:" && ls dist/core/*.whl
98
+
99
+ - uses: actions/upload-artifact@v7
100
+ with:
101
+ name: core-dist
102
+ path: dist/core/
103
+
104
+ publish-core:
105
+ needs: build
106
+ runs-on: ubuntu-latest
107
+ environment: pypi
108
+ permissions:
109
+ id-token: write
110
+ steps:
111
+ - uses: actions/download-artifact@v8
112
+ with:
113
+ name: core-dist
114
+ path: dist/
115
+ - uses: pypa/gh-action-pypi-publish@release/v1
116
+ with:
117
+ # PyPI refuses a version twice; skip instead of failing.
118
+ skip-existing: true
@@ -0,0 +1,79 @@
1
+ name: Publish to TestPyPI
2
+
3
+ # Run by hand: Actions tab -> "Publish to TestPyPI" -> Run workflow.
4
+ # Logs in with Trusted Publishing: the gnome-night-shift project on
5
+ # test.pypi.org needs a publisher with repository
6
+ # christophermca/gnome-night-shift, workflow `publish-testpypi.yml` and
7
+ # environment `test-pypi` (Settings -> Environments in this repo).
8
+ on:
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ test:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v7
16
+ with:
17
+ fetch-depth: 0
18
+
19
+ - uses: actions/setup-python@v7
20
+ with:
21
+ python-version: "3.12"
22
+ cache: pip
23
+
24
+ # PyGObject builds from source on the runner; it needs these headers.
25
+ - name: Install system libraries
26
+ run: |
27
+ sudo apt-get update
28
+ sudo apt-get install -y libgirepository-2.0-dev libcairo2-dev pkg-config libglib2.0-bin
29
+
30
+ # nocturne-shift>=0.5.0 isn't on PyPI yet; install it from its repo
31
+ # first. Drop that line once cli-v0.5.x is released on PyPI.
32
+ - name: Install dependencies
33
+ run: |
34
+ python -m pip install --upgrade pip
35
+ python -m pip install "nocturne-shift @ git+https://github.com/christophermca/nocturne-shift@dev"
36
+ python -m pip install -e ".[test]"
37
+
38
+ - name: Run tests
39
+ run: python -m pytest
40
+
41
+ build:
42
+ needs: test
43
+ runs-on: ubuntu-latest
44
+ steps:
45
+ - uses: actions/checkout@v7
46
+ with:
47
+ fetch-depth: 0 # setuptools-scm reads the gnome-v* tags
48
+
49
+ - uses: actions/setup-python@v7
50
+ with:
51
+ python-version: "3.12"
52
+
53
+ - name: Build
54
+ run: |
55
+ python -m pip install --upgrade pip build twine
56
+ python -m build --outdir dist/
57
+ python -m twine check --strict dist/*
58
+
59
+ - uses: actions/upload-artifact@v7
60
+ with:
61
+ name: dist
62
+ path: dist/
63
+
64
+ publish:
65
+ needs: build
66
+ runs-on: ubuntu-latest
67
+ environment: test-pypi
68
+ permissions:
69
+ id-token: write
70
+ steps:
71
+ - uses: actions/download-artifact@v8
72
+ with:
73
+ name: dist
74
+ path: dist/
75
+ - uses: pypa/gh-action-pypi-publish@release/v1
76
+ with:
77
+ repository-url: https://test.pypi.org/legacy/
78
+ # TestPyPI refuses a version twice; skip instead of failing.
79
+ skip-existing: true
@@ -0,0 +1,43 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ pull_request:
6
+
7
+ jobs:
8
+ test:
9
+ runs-on: ubuntu-latest
10
+ strategy:
11
+ fail-fast: false
12
+ matrix:
13
+ python-version: ["3.11", "3.10"]
14
+
15
+ steps:
16
+ - name: Check out repository
17
+ uses: actions/checkout@v7
18
+ with:
19
+ fetch-depth: 0
20
+
21
+ - name: Set up Python ${{ matrix.python-version }}
22
+ uses: actions/setup-python@v7
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+ cache: pip
26
+
27
+ # PyGObject builds from source on the runner; it needs these headers.
28
+ - name: Install system libraries
29
+ run: |
30
+ sudo apt-get update
31
+ sudo apt-get install -y libgirepository-2.0-dev libcairo2-dev pkg-config libglib2.0-bin
32
+
33
+ # [test] brings pytest and pytest-cov (pytest.ini uses --cov).
34
+ # nocturne-shift>=0.5.0 isn't on PyPI yet; install it from its repo
35
+ # first. Drop that line once cli-v0.5.x is released on PyPI.
36
+ - name: Install dependencies
37
+ run: |
38
+ python -m pip install --upgrade pip
39
+ python -m pip install "nocturne-shift @ git+https://github.com/christophermca/nocturne-shift@dev"
40
+ python -m pip install -e ".[test]"
41
+
42
+ - name: Run tests
43
+ run: python -m pytest
@@ -0,0 +1,221 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ *.lcov
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ # Pipfile.lock
97
+
98
+ # uv
99
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # uv.lock
103
+
104
+ # poetry
105
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
107
+ # commonly ignored for libraries.
108
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109
+ # poetry.lock
110
+ # poetry.toml
111
+
112
+ # pdm
113
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
115
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
116
+ # pdm.lock
117
+ # pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # pixi
122
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
123
+ # pixi.lock
124
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
125
+ # in the .venv directory. It is recommended not to include this directory in version control.
126
+ .pixi/*
127
+ !.pixi/config.toml
128
+
129
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
130
+ __pypackages__/
131
+
132
+ # Celery stuff
133
+ celerybeat-schedule*
134
+ celerybeat.pid
135
+
136
+ # Redis
137
+ *.rdb
138
+ *.aof
139
+ *.pid
140
+
141
+ # RabbitMQ
142
+ mnesia/
143
+ rabbitmq/
144
+ rabbitmq-data/
145
+
146
+ # ActiveMQ
147
+ activemq-data/
148
+
149
+ # SageMath parsed files
150
+ *.sage.py
151
+
152
+ # Environments
153
+ .env
154
+ .envrc
155
+ .venv
156
+ env/
157
+ venv/
158
+ ENV/
159
+ env.bak/
160
+ venv.bak/
161
+
162
+ # Spyder project settings
163
+ .spyderproject
164
+ .spyproject
165
+
166
+ # Rope project settings
167
+ .ropeproject
168
+
169
+ # mkdocs/Zensical documentation
170
+ /site
171
+
172
+ # mypy
173
+ .mypy_cache/
174
+ .dmypy.json
175
+ dmypy.json
176
+
177
+ # Pyre type checker
178
+ .pyre/
179
+
180
+ # pytype static type analyzer
181
+ .pytype/
182
+
183
+ # Cython debug symbols
184
+ cython_debug/
185
+
186
+ # PyCharm
187
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
188
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
189
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
190
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
191
+ # .idea/
192
+
193
+ # Abstra
194
+ # Abstra is an AI-powered process automation framework.
195
+ # Ignore directories containing user credentials, local state, and settings.
196
+ # Learn more at https://abstra.io/docs
197
+ .abstra/
198
+
199
+ # Visual Studio Code
200
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore that
201
+ # can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
202
+ # and can be added to the global gitignore or merged into this file. However, if you prefer, you
203
+ # could uncomment the following to ignore the entire vscode folder
204
+ # .vscode/
205
+ # Temporary file for partial code execution
206
+ tempCodeRunnerFile.py
207
+
208
+ # Ruff stuff:
209
+ .ruff_cache/
210
+
211
+ # PyPI configuration file
212
+ .pypirc
213
+
214
+ # Marimo
215
+ marimo/_static/
216
+ marimo/_lsp/
217
+ __marimo__/
218
+
219
+ # Streamlit
220
+ .streamlit/secrets.toml
221
+ tmp/