Skip to content

Commit ed4cd8b

Browse files
committed
Merge entrypoint-ify: Modernize for Sopel 8
2 parents 3506e90 + b924235 commit ed4cd8b

File tree

21 files changed

+197
-312
lines changed

21 files changed

+197
-312
lines changed

.coveragerc

Lines changed: 0 additions & 29 deletions
This file was deleted.

.github/workflows/python-publish.yml

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,49 @@ name: Upload Python Package
33

44
on:
55
release:
6-
types: [created]
7-
workflow_dispatch:
6+
types: [published]
87

9-
jobs:
10-
deploy:
8+
permissions:
9+
contents: read
1110

11+
jobs:
12+
build:
1213
runs-on: ubuntu-latest
13-
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
16+
1617
- name: Set up Python
17-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v5
1819
with:
19-
python-version: '3.9'
20-
- name: Install dependencies
20+
python-version: '3.12'
21+
22+
- name: Install build tooling
2123
run: |
2224
python -m pip install --upgrade pip
23-
pip install setuptools wheel twine
24-
- name: Build and publish
25-
env:
26-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
27-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
28-
run: |
29-
python setup.py sdist bdist_wheel
30-
twine upload dist/*
25+
python -m pip install build
26+
27+
- name: Build package
28+
run: python -m build
29+
30+
- name: Upload build artifacts
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: built-distributions
34+
path: dist/
35+
36+
upload:
37+
needs: build
38+
runs-on: ubuntu-latest
39+
environment: release
40+
permissions:
41+
id-token: write
42+
contents: read
43+
steps:
44+
- name: Download build artifacts
45+
uses: actions/download-artifact@v4
46+
with:
47+
name: built-distributions
48+
path: dist/
49+
50+
- name: Publish package
51+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/python-tests.yml

Lines changed: 22 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,33 @@ name: Python Tests
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66
pull_request:
7-
branches: [ master ]
7+
branches: [master]
88
workflow_dispatch:
99

1010
jobs:
11-
build:
12-
11+
test:
12+
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
os: [ubuntu-latest]
16-
python-version: [3.7, 3.8, 3.9]
17-
include:
18-
- python-version: 3.6
19-
os: ubuntu-20.04
20-
21-
runs-on: ${{ matrix.os }}
15+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
2216

2317
steps:
24-
- uses: actions/checkout@v2
25-
- name: Set up Python ${{ matrix.python-version }}
26-
uses: actions/setup-python@v2
27-
with:
28-
python-version: ${{ matrix.python-version }}
29-
- name: Install dependencies
30-
run: |
31-
python -m pip install --upgrade pip
32-
python -m pip install flake8 pytest
33-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
34-
if [ -f tests/requirements.txt ]; then pip install -r tests/requirements.txt; fi
35-
- name: Install sopel-weather
36-
run: |
37-
python -m pip install -e .
38-
- name: Lint with flake8
39-
run: |
40-
# stop the build if there are Python syntax errors or undefined names
41-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
42-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
43-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
44-
#- name: Test with pytest
45-
#run: |
46-
#pytest
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
python -m pip install flake8 pytest
29+
python -m pip install -e .
30+
31+
- name: Lint with flake8
32+
run: |
33+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
34+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"esbonio.sphinx.confDir": ""
3+
}

MANIFEST.in

Lines changed: 0 additions & 8 deletions
This file was deleted.

NEWS

Whitespace-only changes.

README.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# sopel-weather
2+
3+
A weather lookup plugin for Sopel IRC bots.
4+
5+
> **Note:** This package was previously published as `sopel-modules.weather`.
6+
> Please update your dependencies to use `sopel-weather` instead.
7+
8+
## Installation
9+
10+
```bash
11+
pip install sopel-weather
12+
```
13+
14+
## Configuration
15+
16+
You can automatically configure this plugin using `sopel configure --plugins`.
17+
18+
Or configure manually in `~/.sopel/default.cfg`:
19+
20+
```ini
21+
[weather]
22+
geocoords_provider = locationiq_us
23+
geocoords_api_key = YOUR_LOCATIONIQ_API_KEY
24+
weather_provider = openmeteo
25+
weather_api_key = dummy
26+
```
27+
28+
## Usage
29+
30+
### Current Weather
31+
32+
```
33+
.weather # Uses your saved location
34+
.weather seattle, us
35+
.weather london
36+
```
37+
38+
Example output:
39+
```
40+
Paris, Ile-de-France, FR: 6°C (42°F), Clear, Humidity: 83%, UV Index: 0, Gentle breeze 4.0m/s (↗)
41+
```
42+
43+
### Forecast
44+
45+
```
46+
.forecast # Uses your saved location
47+
.forecast seattle, us
48+
.forecast london
49+
```
50+
51+
### Set Your Location
52+
53+
```
54+
.setlocation london # Set by city name
55+
.setlocation 98101 # Set by US zip code
56+
```
57+
58+
## API Keys Required
59+
60+
### GeoCoords Provider
61+
- [LocationIQ](https://locationiq.com/) - Free tier available
62+
63+
### Weather Providers
64+
65+
- **Open-Meteo** - No API key required (use any string)
66+
- https://open-meteo.com/
67+
- **OpenWeatherMap** - Free tier available
68+
- https://openweathermap.org/
69+
- **Pirate Weather** - Drop-in Dark Sky replacement
70+
- https://pirateweather.net/
71+
72+
## Requirements
73+
74+
- Sopel 8.0+
75+
- Python 3.8+
76+
77+
## License
78+
79+
MIT License

0 commit comments

Comments
 (0)