pyweatherenriched 0.6.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.
- pyweatherenriched-0.6.0/.github/workflows/release.yml +103 -0
- pyweatherenriched-0.6.0/.github/workflows/tests.yml +17 -0
- pyweatherenriched-0.6.0/.gitignore +31 -0
- pyweatherenriched-0.6.0/BUILD.md +170 -0
- pyweatherenriched-0.6.0/Cargo.lock +2590 -0
- pyweatherenriched-0.6.0/Cargo.toml +50 -0
- pyweatherenriched-0.6.0/LICENSE +22 -0
- pyweatherenriched-0.6.0/PKG-INFO +213 -0
- pyweatherenriched-0.6.0/README.md +179 -0
- pyweatherenriched-0.6.0/SECURITY.md +44 -0
- pyweatherenriched-0.6.0/pyproject.toml +65 -0
- pyweatherenriched-0.6.0/python/pyweatherenriched/__init__.py +49 -0
- pyweatherenriched-0.6.0/python/pyweatherenriched/features.py +276 -0
- pyweatherenriched-0.6.0/src/bin/validate.rs +59 -0
- pyweatherenriched-0.6.0/src/cache.rs +97 -0
- pyweatherenriched-0.6.0/src/enhanced_cache.rs +638 -0
- pyweatherenriched-0.6.0/src/enricher.rs +336 -0
- pyweatherenriched-0.6.0/src/geocoder.rs +159 -0
- pyweatherenriched-0.6.0/src/geospatial/config.rs +278 -0
- pyweatherenriched-0.6.0/src/geospatial/data_source.rs +277 -0
- pyweatherenriched-0.6.0/src/geospatial/elevation.rs +383 -0
- pyweatherenriched-0.6.0/src/geospatial/mod.rs +155 -0
- pyweatherenriched-0.6.0/src/geospatial/optional.rs +153 -0
- pyweatherenriched-0.6.0/src/geospatial/reverse_geocoding.rs +638 -0
- pyweatherenriched-0.6.0/src/geospatial/urban_heat_island.rs +335 -0
- pyweatherenriched-0.6.0/src/lib.rs +363 -0
- pyweatherenriched-0.6.0/src/python_bindings.rs +55 -0
- pyweatherenriched-0.6.0/src/types.rs +15 -0
- pyweatherenriched-0.6.0/tests/test_features.py +206 -0
- pyweatherenriched-0.6.0/tests/test_python_bindings.py +178 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
name: Build and Release Wheels
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: write
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
runs-on: ${{ matrix.os }}
|
|
15
|
+
strategy:
|
|
16
|
+
matrix:
|
|
17
|
+
include:
|
|
18
|
+
# Linux x86_64
|
|
19
|
+
- os: ubuntu-latest
|
|
20
|
+
target: x86_64-unknown-linux-gnu
|
|
21
|
+
python-version: '3.10'
|
|
22
|
+
|
|
23
|
+
# Linux ARM64
|
|
24
|
+
- os: ubuntu-latest
|
|
25
|
+
target: aarch64-unknown-linux-gnu
|
|
26
|
+
python-version: '3.10'
|
|
27
|
+
|
|
28
|
+
# macOS Intel
|
|
29
|
+
- os: macos-latest
|
|
30
|
+
target: x86_64-apple-darwin
|
|
31
|
+
python-version: '3.10'
|
|
32
|
+
|
|
33
|
+
# macOS Apple Silicon
|
|
34
|
+
- os: macos-latest
|
|
35
|
+
target: aarch64-apple-darwin
|
|
36
|
+
python-version: '3.10'
|
|
37
|
+
|
|
38
|
+
# Windows x86_64
|
|
39
|
+
- os: windows-latest
|
|
40
|
+
target: x86_64-pc-windows-msvc
|
|
41
|
+
python-version: '3.10'
|
|
42
|
+
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/checkout@v4
|
|
45
|
+
|
|
46
|
+
- name: Set up Python
|
|
47
|
+
uses: actions/setup-python@v4
|
|
48
|
+
with:
|
|
49
|
+
python-version: ${{ matrix.python-version }}
|
|
50
|
+
|
|
51
|
+
- name: Install Rust
|
|
52
|
+
uses: dtolnay/rust-toolchain@stable
|
|
53
|
+
|
|
54
|
+
- name: Install maturin
|
|
55
|
+
run: pip install maturin
|
|
56
|
+
|
|
57
|
+
- name: Install build dependencies (Linux)
|
|
58
|
+
if: runner.os == 'Linux'
|
|
59
|
+
run: |
|
|
60
|
+
sudo apt-get update
|
|
61
|
+
sudo apt-get install -y libssl-dev pkg-config
|
|
62
|
+
|
|
63
|
+
- name: Build wheels
|
|
64
|
+
run: maturin build --release
|
|
65
|
+
|
|
66
|
+
- name: Upload wheels
|
|
67
|
+
uses: actions/upload-artifact@v3
|
|
68
|
+
with:
|
|
69
|
+
name: wheels-${{ matrix.os }}-${{ matrix.target }}
|
|
70
|
+
path: target/wheels/
|
|
71
|
+
|
|
72
|
+
publish:
|
|
73
|
+
needs: build
|
|
74
|
+
runs-on: ubuntu-latest
|
|
75
|
+
if: startsWith(github.ref, 'refs/tags/v')
|
|
76
|
+
|
|
77
|
+
steps:
|
|
78
|
+
- uses: actions/checkout@v4
|
|
79
|
+
|
|
80
|
+
- name: Download all wheels
|
|
81
|
+
uses: actions/download-artifact@v3
|
|
82
|
+
with:
|
|
83
|
+
path: wheels
|
|
84
|
+
|
|
85
|
+
- name: Flatten wheels directory
|
|
86
|
+
run: |
|
|
87
|
+
mkdir -p flat_wheels
|
|
88
|
+
find wheels -name "*.whl" -exec cp {} flat_wheels/ \;
|
|
89
|
+
|
|
90
|
+
- name: Publish to PyPI
|
|
91
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
92
|
+
with:
|
|
93
|
+
packages-dir: flat_wheels/
|
|
94
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
95
|
+
|
|
96
|
+
- name: Create GitHub Release
|
|
97
|
+
uses: softprops/action-gh-release@v1
|
|
98
|
+
with:
|
|
99
|
+
files: flat_wheels/*.whl
|
|
100
|
+
draft: false
|
|
101
|
+
prerelease: false
|
|
102
|
+
env:
|
|
103
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
on: [push, pull_request]
|
|
3
|
+
jobs:
|
|
4
|
+
test:
|
|
5
|
+
runs-on: ubuntu-latest
|
|
6
|
+
strategy:
|
|
7
|
+
matrix:
|
|
8
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
9
|
+
steps:
|
|
10
|
+
- uses: actions/checkout@v4
|
|
11
|
+
- uses: actions/setup-python@v4
|
|
12
|
+
with:
|
|
13
|
+
python-version: ${{ matrix.python-version }}
|
|
14
|
+
- name: Install
|
|
15
|
+
run: pip install -e ".[dev]" 2>/dev/null || pip install -e .
|
|
16
|
+
- name: Test
|
|
17
|
+
run: pytest
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
target/
|
|
2
|
+
|
|
3
|
+
# Python Build Artifacts
|
|
4
|
+
build/
|
|
5
|
+
dist/
|
|
6
|
+
*.whl
|
|
7
|
+
*.egg-info/
|
|
8
|
+
__pycache__/
|
|
9
|
+
*.pyc
|
|
10
|
+
.eggs/
|
|
11
|
+
*.so
|
|
12
|
+
*.pyd
|
|
13
|
+
|
|
14
|
+
# Dependencies
|
|
15
|
+
.venv/
|
|
16
|
+
venv/
|
|
17
|
+
env/
|
|
18
|
+
|
|
19
|
+
# IDE/Editor
|
|
20
|
+
.vscode/
|
|
21
|
+
.idea/
|
|
22
|
+
*.swp
|
|
23
|
+
.DS_Store
|
|
24
|
+
|
|
25
|
+
# Cache
|
|
26
|
+
.pytest_cache/
|
|
27
|
+
.mypy_cache/
|
|
28
|
+
|
|
29
|
+
# Environment
|
|
30
|
+
.env
|
|
31
|
+
.env.local
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Build Instructions
|
|
2
|
+
|
|
3
|
+
PyWeatherEnriched ships to PyPI as prebuilt wheels. Source is on GitHub at
|
|
4
|
+
https://github.com/Mullassery/PyWeatherEnriched under a proprietary license
|
|
5
|
+
(see `LICENSE`) — visible for review, not open for redistribution/reuse
|
|
6
|
+
without permission.
|
|
7
|
+
|
|
8
|
+
## Installation from PyPI
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pip install pyweatherenriched
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Requires Python 3.10 or higher.
|
|
15
|
+
|
|
16
|
+
Supported platforms:
|
|
17
|
+
- Linux (x86_64, ARM64)
|
|
18
|
+
- macOS (Intel, Apple Silicon)
|
|
19
|
+
- Windows (x86_64)
|
|
20
|
+
|
|
21
|
+
## Building Wheels (For Maintainers)
|
|
22
|
+
|
|
23
|
+
PyWeatherEnriched uses Maturin to build PyO3 wheels from Rust source code.
|
|
24
|
+
|
|
25
|
+
### Prerequisites
|
|
26
|
+
|
|
27
|
+
1. **Rust toolchain** (latest stable):
|
|
28
|
+
```bash
|
|
29
|
+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|
30
|
+
source $HOME/.cargo/env
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
2. **Python 3.10+** with development headers:
|
|
34
|
+
```bash
|
|
35
|
+
# Linux (Debian/Ubuntu)
|
|
36
|
+
sudo apt-get install python3.10-dev
|
|
37
|
+
|
|
38
|
+
# macOS
|
|
39
|
+
brew install python@3.10
|
|
40
|
+
|
|
41
|
+
# Windows
|
|
42
|
+
# Install from python.org or use Windows Store
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
3. **Maturin**:
|
|
46
|
+
```bash
|
|
47
|
+
pip install maturin
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Build Steps
|
|
51
|
+
|
|
52
|
+
1. **Build wheels for your current platform**:
|
|
53
|
+
```bash
|
|
54
|
+
cd /path/to/PyWeatherEnriched
|
|
55
|
+
maturin build --release
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Wheels appear in `target/wheels/`
|
|
59
|
+
|
|
60
|
+
2. **Build wheels for multiple Python versions**:
|
|
61
|
+
```bash
|
|
62
|
+
maturin build --release -i python3.10 -i python3.11 -i python3.12 -i python3.13
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
3. **Build wheels for multiple platforms** (cross-compilation):
|
|
66
|
+
```bash
|
|
67
|
+
# Linux x86_64 and ARM64
|
|
68
|
+
maturin build --release --target x86_64-unknown-linux-gnu
|
|
69
|
+
maturin build --release --target aarch64-unknown-linux-gnu
|
|
70
|
+
|
|
71
|
+
# macOS Intel and Apple Silicon
|
|
72
|
+
maturin build --release --target x86_64-apple-darwin
|
|
73
|
+
maturin build --release --target aarch64-apple-darwin
|
|
74
|
+
|
|
75
|
+
# Windows x86_64
|
|
76
|
+
maturin build --release --target x86_64-pc-windows-msvc
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Upload to PyPI
|
|
80
|
+
|
|
81
|
+
Using Twine:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Install twine
|
|
85
|
+
pip install twine
|
|
86
|
+
|
|
87
|
+
# Upload wheels
|
|
88
|
+
twine upload target/wheels/pyweatherenriched*.whl
|
|
89
|
+
|
|
90
|
+
# With token authentication
|
|
91
|
+
twine upload --repository pypi target/wheels/pyweatherenriched*.whl
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## GitHub Actions (Automatic Builds)
|
|
95
|
+
|
|
96
|
+
The repository includes a GitHub Actions workflow (`.github/workflows/release.yml`) that:
|
|
97
|
+
- Builds wheels for Linux, macOS, and Windows
|
|
98
|
+
- Runs on each release tag
|
|
99
|
+
- Automatically uploads to PyPI
|
|
100
|
+
|
|
101
|
+
To create a release:
|
|
102
|
+
```bash
|
|
103
|
+
git tag v0.1.0
|
|
104
|
+
git push origin v0.1.0
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Wheel Contents
|
|
108
|
+
|
|
109
|
+
Each wheel contains:
|
|
110
|
+
- `pyweatherenriched._pyweatherenriched`, the compiled Rust/PyO3 extension module (.so/.pyd)
|
|
111
|
+
- The pure-Python `pyweatherenriched` package (`__init__.py`, `features.py`)
|
|
112
|
+
- Metadata and license information
|
|
113
|
+
|
|
114
|
+
## Troubleshooting
|
|
115
|
+
|
|
116
|
+
### "No module named 'maturin'"
|
|
117
|
+
```bash
|
|
118
|
+
pip install maturin
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Python version mismatch
|
|
122
|
+
Ensure your Python installation matches the wheel being built:
|
|
123
|
+
```bash
|
|
124
|
+
python --version
|
|
125
|
+
maturin build -i /path/to/python3.10
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Rust compilation errors
|
|
129
|
+
Update Rust:
|
|
130
|
+
```bash
|
|
131
|
+
rustup update stable
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### OpenSSL errors on Linux
|
|
135
|
+
```bash
|
|
136
|
+
sudo apt-get install libssl-dev
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Distribution Policy
|
|
140
|
+
|
|
141
|
+
- **PyPI**: Prebuilt wheels (verified via `pip install`)
|
|
142
|
+
- **GitHub Releases**: Wheels as binary artifacts
|
|
143
|
+
- **Source**: Public on GitHub, proprietary license (see LICENSE file — review is fine, redistribution/reuse is not)
|
|
144
|
+
|
|
145
|
+
## Support
|
|
146
|
+
|
|
147
|
+
For build issues:
|
|
148
|
+
- GitHub Issues: https://github.com/Mullassery/PyWeatherEnriched/issues
|
|
149
|
+
- Email: mullassery@gmail.com
|
|
150
|
+
|
|
151
|
+
## Development Setup
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
# Clone repository
|
|
155
|
+
git clone https://github.com/Mullassery/PyWeatherEnriched.git
|
|
156
|
+
cd PyWeatherEnriched
|
|
157
|
+
|
|
158
|
+
# Build development mode (installs the extension into your active venv)
|
|
159
|
+
maturin develop --release
|
|
160
|
+
|
|
161
|
+
# Run the Rust test suite
|
|
162
|
+
cargo test
|
|
163
|
+
|
|
164
|
+
# Run the Python test suite (needs `maturin develop` first)
|
|
165
|
+
pip install -e ".[dev]"
|
|
166
|
+
pytest tests/ -v
|
|
167
|
+
|
|
168
|
+
# Build optimized wheels
|
|
169
|
+
maturin build --release
|
|
170
|
+
```
|