focale-local-relay 0.4.0__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 (38) hide show
  1. focale_local_relay-0.4.0/.claude/launch.json +11 -0
  2. focale_local_relay-0.4.0/.github/workflows/ci.yml +30 -0
  3. focale_local_relay-0.4.0/.github/workflows/publish.yml +32 -0
  4. focale_local_relay-0.4.0/.github/workflows/windows-production.yml +129 -0
  5. focale_local_relay-0.4.0/.github/workflows/windows-staging.yml +115 -0
  6. focale_local_relay-0.4.0/.gitignore +207 -0
  7. focale_local_relay-0.4.0/LICENSE +21 -0
  8. focale_local_relay-0.4.0/PKG-INFO +171 -0
  9. focale_local_relay-0.4.0/README.md +115 -0
  10. focale_local_relay-0.4.0/packaging/windows/focale.iss +90 -0
  11. focale_local_relay-0.4.0/pyproject.toml +59 -0
  12. focale_local_relay-0.4.0/scripts/build_windows.ps1 +82 -0
  13. focale_local_relay-0.4.0/src/focale_local_relay/__init__.py +21 -0
  14. focale_local_relay-0.4.0/src/focale_local_relay/__main__.py +12 -0
  15. focale_local_relay-0.4.0/src/focale_local_relay/_environment.py +5 -0
  16. focale_local_relay-0.4.0/src/focale_local_relay/agent_auth.py +93 -0
  17. focale_local_relay-0.4.0/src/focale_local_relay/alpaca.py +456 -0
  18. focale_local_relay-0.4.0/src/focale_local_relay/assets/README.md +8 -0
  19. focale_local_relay-0.4.0/src/focale_local_relay/assets/app-icon.ico +0 -0
  20. focale_local_relay-0.4.0/src/focale_local_relay/assets/app-icon.png +0 -0
  21. focale_local_relay-0.4.0/src/focale_local_relay/assets/app-icon.svg +34 -0
  22. focale_local_relay-0.4.0/src/focale_local_relay/branding.py +69 -0
  23. focale_local_relay-0.4.0/src/focale_local_relay/centering.py +362 -0
  24. focale_local_relay-0.4.0/src/focale_local_relay/cli.py +821 -0
  25. focale_local_relay-0.4.0/src/focale_local_relay/exceptions.py +22 -0
  26. focale_local_relay-0.4.0/src/focale_local_relay/gui.py +879 -0
  27. focale_local_relay-0.4.0/src/focale_local_relay/gui_main.py +9 -0
  28. focale_local_relay-0.4.0/src/focale_local_relay/hub.py +312 -0
  29. focale_local_relay-0.4.0/src/focale_local_relay/hub_gateway.py +578 -0
  30. focale_local_relay-0.4.0/src/focale_local_relay/platesolver.py +217 -0
  31. focale_local_relay-0.4.0/src/focale_local_relay/services.py +1622 -0
  32. focale_local_relay-0.4.0/src/focale_local_relay/state.py +211 -0
  33. focale_local_relay-0.4.0/tests/test_agent_auth.py +26 -0
  34. focale_local_relay-0.4.0/tests/test_alpaca.py +19 -0
  35. focale_local_relay-0.4.0/tests/test_gui_main.py +28 -0
  36. focale_local_relay-0.4.0/tests/test_state.py +83 -0
  37. focale_local_relay-0.4.0/tests/test_version.py +20 -0
  38. focale_local_relay-0.4.0/uv.lock +753 -0
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": "0.0.1",
3
+ "configurations": [
4
+ {
5
+ "name": "pytest",
6
+ "runtimeExecutable": "uv",
7
+ "runtimeArgs": ["run", "--extra", "dev", "pytest", "-v"],
8
+ "port": 0
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,30 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ python-version: ["3.10", "3.11", "3.12"]
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install package
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ python -m pip install -e .[dev]
28
+
29
+ - name: Run tests
30
+ run: pytest -q
@@ -0,0 +1,32 @@
1
+ name: Publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ environment: pypi
13
+ permissions:
14
+ contents: read
15
+ id-token: write
16
+
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - uses: actions/setup-python@v5
21
+ with:
22
+ python-version: "3.12"
23
+
24
+ - name: Build distributions
25
+ run: |
26
+ python -m pip install --upgrade pip build
27
+ python -m build
28
+
29
+ - name: Publish to PyPI (OIDC)
30
+ uses: pypa/gh-action-pypi-publish@release/v1
31
+ with:
32
+ packages-dir: dist
@@ -0,0 +1,129 @@
1
+ name: Windows Installer — Production
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+ inputs:
9
+ ref:
10
+ description: "Git ref to build (e.g. refs/tags/v0.3.0)"
11
+ required: false
12
+ default: ""
13
+ version:
14
+ description: "Version string (e.g. 0.3.0). Defaults to the tag name."
15
+ required: false
16
+ default: ""
17
+
18
+ jobs:
19
+ build:
20
+ runs-on: windows-latest
21
+ permissions:
22
+ contents: write
23
+
24
+ steps:
25
+ - uses: actions/checkout@v4
26
+ with:
27
+ ref: ${{ inputs.ref || github.ref }}
28
+
29
+ - uses: actions/setup-python@v5
30
+ with:
31
+ python-version: "3.12"
32
+
33
+ - name: Derive version
34
+ id: version
35
+ shell: pwsh
36
+ run: |
37
+ $version = "${{ inputs.version }}"
38
+ if ([string]::IsNullOrWhiteSpace($version)) {
39
+ $version = "${{ github.ref_name }}"
40
+ if ($version.StartsWith("refs/tags/")) { $version = $version.Substring(10) }
41
+ if ($version.StartsWith("v")) { $version = $version.Substring(1) }
42
+ }
43
+ if ([string]::IsNullOrWhiteSpace($version)) { $version = "0.0.0" }
44
+ Write-Host "Version: $version"
45
+ "value=$version" >> $env:GITHUB_OUTPUT
46
+
47
+ - name: Bake production environment
48
+ shell: pwsh
49
+ run: |
50
+ Set-Content -Path "src/focale_local_relay/_environment.py" -Value @"
51
+ # Generated at build time — do not edit.
52
+ ENVIRONMENT = "production"
53
+ "@
54
+
55
+ - name: Install build dependencies
56
+ shell: pwsh
57
+ run: |
58
+ python -m pip install --upgrade pip
59
+ python -m pip install .[dev]
60
+
61
+ - name: Build executable
62
+ shell: pwsh
63
+ run: |
64
+ pyinstaller `
65
+ --noconfirm `
66
+ --clean `
67
+ --onedir `
68
+ --windowed `
69
+ --name "focale" `
70
+ --paths src `
71
+ --collect-submodules arcsecond `
72
+ --collect-submodules astrometry `
73
+ --hidden-import astrometry_extension `
74
+ --collect-submodules focale_local_relay `
75
+ src/focale_local_relay/gui_main.py
76
+
77
+ - name: Install Inno Setup
78
+ id: innosetup
79
+ shell: pwsh
80
+ run: |
81
+ $candidates = @(
82
+ "$env:RUNNER_TEMP\InnoSetup\ISCC.exe",
83
+ "$env:ProgramFiles(x86)\Inno Setup 6\ISCC.exe",
84
+ "$env:ProgramFiles\Inno Setup 6\ISCC.exe"
85
+ )
86
+ $iscc = $candidates | Where-Object { Test-Path $_ } | Select-Object -First 1
87
+ if (-not $iscc) {
88
+ $installer = Join-Path $env:RUNNER_TEMP "innosetup-6.7.1.exe"
89
+ $installDir = Join-Path $env:RUNNER_TEMP "InnoSetup"
90
+ Invoke-WebRequest `
91
+ -Uri "https://github.com/jrsoftware/issrc/releases/download/is-6_7_1/innosetup-6.7.1.exe" `
92
+ -OutFile $installer
93
+ $process = Start-Process -FilePath $installer `
94
+ -ArgumentList "/VERYSILENT", "/SUPPRESSMSGBOXES", "/NORESTART", "/SP-", "/DIR=$installDir" `
95
+ -Wait -PassThru
96
+ if ($process.ExitCode -ne 0) { throw "Inno Setup install failed: $($process.ExitCode)" }
97
+ $iscc = $candidates | Where-Object { Test-Path $_ } | Select-Object -First 1
98
+ }
99
+ if (-not $iscc) { throw "Unable to locate ISCC.exe." }
100
+ "path=$iscc" >> $env:GITHUB_OUTPUT
101
+
102
+ - name: Build installer
103
+ shell: pwsh
104
+ run: |
105
+ $sourceDir = (Resolve-Path "dist\focale").Path
106
+ $outputDir = Join-Path $PWD "dist\windows"
107
+ New-Item -ItemType Directory -Force -Path $outputDir | Out-Null
108
+ & "${{ steps.innosetup.outputs.path }}" `
109
+ /DMyAppVersion="${{ steps.version.outputs.value }}" `
110
+ "/DMyAppName=Focale" `
111
+ "/DMyAppId=11A3125E-D7EA-487D-9998-67E95343F4A5" `
112
+ "/DMyExeName=focale.exe" `
113
+ "/DMyDefaultDirName={autopf}\FocaleLocalRelay\Focale" `
114
+ "/DMySourceDir=$sourceDir" `
115
+ "/DMyOutputDir=$outputDir" `
116
+ packaging/windows/focale.iss
117
+
118
+ - name: Upload installer artifact
119
+ uses: actions/upload-artifact@v4
120
+ with:
121
+ name: focale-production-windows-${{ steps.version.outputs.value }}
122
+ path: dist/windows/*.exe
123
+
124
+ - name: Publish to GitHub Release
125
+ uses: softprops/action-gh-release@v2
126
+ with:
127
+ tag_name: v${{ steps.version.outputs.value }}
128
+ files: dist/windows/*.exe
129
+ generate_release_notes: true
@@ -0,0 +1,115 @@
1
+ name: Windows Installer — Staging
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ workflow_dispatch:
8
+ inputs:
9
+ ref:
10
+ description: "Git ref to build"
11
+ required: false
12
+ default: ""
13
+
14
+ jobs:
15
+ build:
16
+ runs-on: windows-latest
17
+ permissions:
18
+ contents: write
19
+
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ with:
23
+ ref: ${{ inputs.ref || github.ref }}
24
+
25
+ - uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.12"
28
+
29
+ - name: Derive version
30
+ id: version
31
+ shell: pwsh
32
+ run: |
33
+ $toml = Get-Content pyproject.toml -Raw
34
+ if ($toml -match 'version\s*=\s*"([^"]+)"') { $base = $Matches[1] } else { $base = "0.0.0" }
35
+ $sha = "${{ github.sha }}".Substring(0, 7)
36
+ $version = "$base-staging.$sha"
37
+ Write-Host "Version: $version"
38
+ "value=$version" >> $env:GITHUB_OUTPUT
39
+
40
+ - name: Bake staging environment
41
+ shell: pwsh
42
+ run: |
43
+ Set-Content -Path "src/focale_local_relay/_environment.py" -Value @"
44
+ # Generated at build time — do not edit.
45
+ ENVIRONMENT = "staging"
46
+ "@
47
+
48
+ - name: Install build dependencies
49
+ shell: pwsh
50
+ run: |
51
+ python -m pip install --upgrade pip
52
+ python -m pip install .[dev]
53
+
54
+ - name: Build executable
55
+ shell: pwsh
56
+ run: |
57
+ pyinstaller `
58
+ --noconfirm `
59
+ --clean `
60
+ --onedir `
61
+ --windowed `
62
+ --name "focale-staging" `
63
+ --paths src `
64
+ --collect-submodules arcsecond `
65
+ --collect-submodules astrometry `
66
+ --hidden-import astrometry_extension `
67
+ --collect-submodules focale_local_relay `
68
+ src/focale_local_relay/gui_main.py
69
+
70
+ - name: Install Inno Setup
71
+ id: innosetup
72
+ shell: pwsh
73
+ run: |
74
+ $candidates = @(
75
+ "$env:RUNNER_TEMP\InnoSetup\ISCC.exe",
76
+ "$env:ProgramFiles(x86)\Inno Setup 6\ISCC.exe",
77
+ "$env:ProgramFiles\Inno Setup 6\ISCC.exe"
78
+ )
79
+ $iscc = $candidates | Where-Object { Test-Path $_ } | Select-Object -First 1
80
+ if (-not $iscc) {
81
+ $installer = Join-Path $env:RUNNER_TEMP "innosetup-6.7.1.exe"
82
+ $installDir = Join-Path $env:RUNNER_TEMP "InnoSetup"
83
+ Invoke-WebRequest `
84
+ -Uri "https://github.com/jrsoftware/issrc/releases/download/is-6_7_1/innosetup-6.7.1.exe" `
85
+ -OutFile $installer
86
+ $process = Start-Process -FilePath $installer `
87
+ -ArgumentList "/VERYSILENT", "/SUPPRESSMSGBOXES", "/NORESTART", "/SP-", "/DIR=$installDir" `
88
+ -Wait -PassThru
89
+ if ($process.ExitCode -ne 0) { throw "Inno Setup install failed: $($process.ExitCode)" }
90
+ $iscc = $candidates | Where-Object { Test-Path $_ } | Select-Object -First 1
91
+ }
92
+ if (-not $iscc) { throw "Unable to locate ISCC.exe." }
93
+ "path=$iscc" >> $env:GITHUB_OUTPUT
94
+
95
+ - name: Build installer
96
+ shell: pwsh
97
+ run: |
98
+ $sourceDir = (Resolve-Path "dist\focale-staging").Path
99
+ $outputDir = Join-Path $PWD "dist\windows"
100
+ New-Item -ItemType Directory -Force -Path $outputDir | Out-Null
101
+ & "${{ steps.innosetup.outputs.path }}" `
102
+ /DMyAppVersion="${{ steps.version.outputs.value }}" `
103
+ "/DMyAppName=Focale Staging" `
104
+ "/DMyAppId=5B3A2E10-7C4D-4F9A-B1E8-2D6F0A3C5E71" `
105
+ "/DMyExeName=focale-staging.exe" `
106
+ "/DMyDefaultDirName={autopf}\FocaleLocalRelay\Focale Staging" `
107
+ "/DMySourceDir=$sourceDir" `
108
+ "/DMyOutputDir=$outputDir" `
109
+ packaging/windows/focale.iss
110
+
111
+ - name: Upload installer artifact
112
+ uses: actions/upload-artifact@v4
113
+ with:
114
+ name: focale-staging-windows-${{ steps.version.outputs.value }}
115
+ path: dist/windows/*.exe
@@ -0,0 +1,207 @@
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
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 4Pi Technologies
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.