-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to development with Poetry (#45)
* Move to Poetry dev environment * Move package code to src folder * Move examples to seperate folder * Update development environment setup in README.md * Add and run black * Update CI tests workflow to use Poetry * Bump minimal python version to 3.11 * Update coverage report fail_under threshold to 60 * add blank line to file
- Loading branch information
1 parent
f7fa998
commit 6e53f8e
Showing
13 changed files
with
1,048 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,17 +15,21 @@ jobs: | |
|
||
steps: | ||
- uses: actions/[email protected] | ||
- name: 🏗 Set up Poetry | ||
run: pipx install poetry | ||
- name: Set up Python 3.11 | ||
uses: actions/[email protected] | ||
with: | ||
python-version: 3.11 | ||
- name: Install dependencies | ||
- name: 🏗 Install workflow dependencies | ||
run: | | ||
pip install . | ||
pip install -r requirements-test.txt | ||
poetry config virtualenvs.create true | ||
poetry config virtualenvs.in-project true | ||
- name: 🏗 Install dependencies | ||
run: poetry install --no-interaction | ||
- name: Lint with flake8 | ||
run: | | ||
flake8 forecast_solar | ||
- name: Run tests | ||
poetry run flake8 src/forecast_solar | ||
- name: 🚀 Run pytest | ||
run: | | ||
pytest tests | ||
poetry run pytest -v --cov src tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
[tool.poetry] | ||
name = "forecast-solar" | ||
version = "0.0.0" | ||
description = "Asynchronous Python client for getting forecast solar information" | ||
authors = ["Klaas Schoute <[email protected]>"] | ||
maintainers = ["Klaas Schoute <[email protected]>"] | ||
license = "MIT" | ||
readme = "README.md" | ||
homepage = "https://github.com/home-assistant-libs/forecast_solar" | ||
repository = "https://github.com/home-assistant-libs/forecast_solar" | ||
documentation = "https://github.com/home-assistant-libs/forecast_solar" | ||
keywords = ["forecast", "solar", "power", "energy", "api", "async", "client"] | ||
classifiers = [ | ||
"Framework :: AsyncIO", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Natural Language :: English", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
] | ||
packages = [ | ||
{ include = "forecast_solar", from = "src" }, | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
aiohttp = ">=3.0.0" | ||
aiodns = ">=3.0.0" | ||
python = "^3.11" | ||
yarl = ">=1.6.0" | ||
|
||
[tool.poetry.urls] | ||
"Bug Tracker" = "https://github.com/home-assistant-libs/forecast_solar/issues" | ||
Changelog = "https://github.com/home-assistant-libs/forecast_solar/releases" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
black = "24.4.2" | ||
covdefaults = "2.3.0" | ||
coverage = {version = "7.5.0", extras = ["toml"]} | ||
flake8 = "7.0.0" | ||
pytest = "8.1.1" | ||
pytest-asyncio = "0.23.6" | ||
pytest-cov = "5.0.0" | ||
|
||
[tool.coverage.run] | ||
plugins = ["covdefaults"] | ||
source = ["forecast_solar"] | ||
|
||
[tool.coverage.report] | ||
fail_under = 60 | ||
show_missing = true | ||
|
||
[tool.pytest.ini_options] | ||
addopts = "--cov" | ||
asyncio_mode = "auto" | ||
|
||
[build-system] | ||
build-backend = "poetry.core.masonry.api" | ||
requires = ["poetry-core>=1.0.0"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
"""Asynchronous Python client for the Forecast.Solar API.""" | ||
|
||
from .exceptions import ( | ||
ForecastSolarError, | ||
ForecastSolarConnectionError, | ||
ForecastSolarConfigError, | ||
ForecastSolarAuthenticationError, | ||
ForecastSolarRequestError, | ||
ForecastSolarRatelimit, | ||
) | ||
from .models import Estimate, AccountType, Ratelimit | ||
from .forecast_solar import ForecastSolar | ||
|
||
__all__ = [ | ||
"AccountType", | ||
"Estimate", | ||
"ForecastSolar", | ||
"ForecastSolarAuthenticationError", | ||
"ForecastSolarConfigError", | ||
"ForecastSolarConnectionError", | ||
"ForecastSolarError", | ||
"ForecastSolarRatelimit", | ||
"ForecastSolarRequestError", | ||
"Ratelimit", | ||
] |
1 change: 1 addition & 0 deletions
1
forecast_solar/exceptions.py → src/forecast_solar/exceptions.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Exceptions for Forecast.Solar.""" | ||
|
||
from datetime import datetime | ||
|
||
|
||
|
1 change: 1 addition & 0 deletions
1
forecast_solar/__init__.py → src/forecast_solar/forecast_solar.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
"""Tests.""" | ||
|
||
from datetime import datetime | ||
from unittest.mock import patch, Mock | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters