Skip to content

Commit 1622276

Browse files
committed
integrated poetry
1 parent 0f01bcd commit 1622276

File tree

4 files changed

+40
-50
lines changed

4 files changed

+40
-50
lines changed

.github/workflows/test.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,18 @@ jobs:
2323
- name: Set up Python
2424
uses: actions/setup-python@v4
2525
with:
26-
python-version: '3.12.5' # Specify Python version (e.g., '3.9')
26+
python-version: '3.11.9' # Specify Python version (e.g., '3.9')
2727

28-
# Install dependencies (you can specify requirements.txt or pyproject.toml)
28+
# Install Poetry
29+
- name: Install Poetry
30+
run: |
31+
curl -sSL https://install.python-poetry.org | python3 -
32+
export PATH="$HOME/.local/bin:$PATH"
33+
34+
# Install dependencies using Poetry
2935
- name: Install dependencies
3036
run: |
31-
python -m pip install --upgrade pip
32-
pip install pytest pandas numpy entsoe-py redis tensorflow scikit-learn sphinx matplotlib
33-
pip install .
37+
poetry install
3438
3539
# Run pytest to execute tests
3640
- name: Generate .config file inside the test folder
@@ -40,4 +44,4 @@ jobs:
4044
echo "enable_energy_caching=false" >> .codegreencore.config
4145
- name: Run tests
4246
run: |
43-
pytest
47+
poetry run pytest

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
exclude_patterns = []
2424

2525

26-
autodoc_mock_imports = ["redis","pandas","entsoe","dateutil","tensorflow","numpy","sklearn"]
26+
autodoc_mock_imports = ["redis","pandas","entsoe","dateutil","tensorflow","numpy","sklearn","matplotlib"]
2727

2828
extensions = ['sphinx.ext.autodoc','docs._extensions.country_table_extension','sphinx.ext.mathjax']
2929

pyproject.toml

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,32 @@
1-
[build-system]
2-
requires = ["setuptools>=61.0",
3-
"requests",
4-
"pandas",
5-
"numpy",
6-
"entsoe-py",
7-
"codecarbon",
8-
"redis",
9-
"scikit-learn",
10-
"tensorflow",
11-
"sphinx",
12-
"matplotlib"
13-
]
1+
[tool.poetry]
2+
name = "codegreen-core"
3+
version = "0.5.0"
4+
description = "This package helps you become aware of the carbon footprint of your computation"
5+
authors = ["Anne Hartebrodt <anne.hartebrodt@fau.de>","Shubh Vardhan Jain <shubh.v.jain@fau.de>"]
6+
readme = "README.md"
147

15-
build-backend = "setuptools.build_meta"
8+
[tool.poetry.dependencies]
9+
python = ">=3.10, <3.12"
10+
entsoe-py = "^0.6.13"
11+
redis = "^5.1.1"
12+
requests = "^2.32.3"
13+
pandas = "2.2.3"
14+
numpy = "<2.0.0"
15+
tensorflow = "^2.18.0"
16+
matplotlib = "^3.9.2"
17+
scikit-learn = "^1.5.2"
1618

17-
[project]
18-
name = "codegreen_core"
19-
version = "0.0.1"
20-
authors = [
21-
{ name="Anne Hartebrodt", email="anne.hartebrodt@fau.de" },
22-
]
23-
description = "Codegreen -- make your computations carbon-aware"
24-
readme = "README.md"
25-
requires-python = ">=3.9"
26-
classifiers = [
27-
"Programming Language :: Python :: 3",
28-
"License :: OSI Approved :: MIT License",
29-
"Operating System :: OS Independent",
30-
]
3119

32-
[project.urls]
33-
"Homepage" = "https://codegreen.world"
34-
"Bug Tracker" = "https://github.com/bionetslab/codegreen-core/issues"
20+
[tool.poetry.group.dev.dependencies]
21+
pytest = "^8.3.3"
22+
Sphinx = "^8.1.3"
23+
24+
[build-system]
25+
requires = ["poetry-core"]
26+
build-backend = "poetry.core.masonry.api"
27+
28+
# Specify additional package data (similar to include_package_data)
29+
#[tool.poetry.package.include]
30+
#"codegreen_core/utilities/country_list.json" = { format = "file" }
31+
#"codegreen_core/utilities/ci_default_values.csv" = { format = "file" }
32+
#"codegreen_core/utilities/model_details.json" = { format = "file" }

setup.py

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

0 commit comments

Comments
 (0)