Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to using pyproject for dependencies #623

Merged
merged 8 commits into from
Nov 4, 2024
Merged

Conversation

mrchrisadams
Copy link
Member

This pull request includes several changes across different files to improve code quality, functionality, and configuration. The most important changes include the removal of an unused fixture, modifications to the fake_evidence function, updates to import statements, the addition of a justfile for task automation, and the introduction of a pyproject.toml for project configuration.

Codebase simplification:

  • Removed the mock_open fixture from apps/accounts/tests/test_provider_request.py as it was not being used.
  • Updated the fake_evidence function in apps/accounts/tests/test_provider_request.py to use io.BytesIO for file creation.
  • Removed the mock_open parameter from the test_evidence_validation_fails function in apps/accounts/tests/test_provider_request.py.

Code improvements:

  • Consolidated import statements in apps/greencheck/api/views.py to improve readability.
  • Replaced the deprecated length_is filter with length in several HTML templates to ensure compatibility with newer Django versions. [1] [2] [3]

Configuration and dependencies:

  • Added a justfile to automate common development tasks, such as creating a virtual environment, running tests, and deploying releases.
  • Introduced a pyproject.toml file for managing project dependencies and configurations, replacing requirements/requirements.in and requirements/requirements.dev.in. [1] [2] [3]

Copy link

github-actions bot commented Nov 4, 2024

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 20.0104 556.571 3.41 163
checkout 7.25 3.53279 1.77 2
pip install uv wheel 21.975 15.9429 3.99 4
pip install requirements 66.212 32.0013 6.40 5
pytest 18.3221 505.094 3.41 148

🌳 CO2 Data:
City: San Jose, Lat: 37.1835, Lon: -121.7714
IP: 13.83.1.210
CO₂ from energy is: 0.155839880 g
CO₂ from manufacturing (embodied carbon) is: 0.046506151 g
Carbon Intensity for this location: 280 gCO₂eq/kWh
SCI: 0.202346 gCO₂eq / pipeline run emitted

Copy link

github-actions bot commented Nov 4, 2024

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 16.0354 655.879 3.20 205
checkout 10.93 3.66295 3.66 1
pip install uv wheel 11.03 3.66521 1.83 2
pip install requirements 67.906 32.5452 5.42 6
pytest 14.64 616.006 3.18 194

🌳 CO2 Data:
City: Boydton, Lat: 36.6676, Lon: -78.3875
IP: 20.161.78.56
CO₂ from energy is: 0.218407707 g
CO₂ from manufacturing (embodied carbon) is: 0.058489331 g
Carbon Intensity for this location: 333 gCO₂eq/kWh
SCI: 0.276897 gCO₂eq / pipeline run emitted

Copy link

github-actions bot commented Nov 4, 2024

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 22.7717 482.319 3.57 135
checkout 15.34 3.81398 3.81 1
pip install uv wheel 15.39 3.81313 3.81 1
pip install requirements 64.74 25.2792 5.06 5
pytest 20.9575 449.413 3.62 124

🌳 CO2 Data:
City: Boydton, Lat: 36.6676, Lon: -78.3875
IP: 20.161.77.192
CO₂ from energy is: 0.160129908 g
CO₂ from manufacturing (embodied carbon) is: 0.038517364 g
Carbon Intensity for this location: 332 gCO₂eq/kWh
SCI: 0.198647 gCO₂eq / pipeline run emitted

Copy link

github-actions bot commented Nov 4, 2024

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 20.5854 526.042 3.51 150
checkout 6.42 3.50829 1.75 2
pip install uv wheel 6.51 3.50668 1.75 2
pip install requirements 66.204 31.8792 5.31 6
pytest 19.1266 487.147 3.50 139

🌳 CO2 Data:
City: Washington, Lat: 38.7095, Lon: -78.1539
IP: 20.84.127.29
CO₂ from energy is: 0.174645944 g
CO₂ from manufacturing (embodied carbon) is: 0.042797071 g
Carbon Intensity for this location: 332 gCO₂eq/kWh
SCI: 0.217443 gCO₂eq / pipeline run emitted

Copy link

github-actions bot commented Nov 4, 2024

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 18.7933 575.521 3.35 172
checkout 13.5 3.75786 3.76 1
pip install uv wheel 13.58 3.75579 1.88 2
pip install requirements 65.035 25.5319 4.26 6
pytest 17.1841 542.475 3.37 161

🌳 CO2 Data:
City: Boydton, Lat: 36.6676, Lon: -78.3875
IP: 20.161.78.238
CO₂ from energy is: 0.191072972 g
CO₂ from manufacturing (embodied carbon) is: 0.049073975 g
Carbon Intensity for this location: 332 gCO₂eq/kWh
SCI: 0.240147 gCO₂eq / pipeline run emitted

Copy link

github-actions bot commented Nov 4, 2024

Old Energy Estimation

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 18.5105 602.723 3.35 180
checkout 7.54 3.54493 3.54 1
pip install uv wheel 7.64 3.54705 1.77 2
pip install requirements 68.242 33.0471 5.51 6
pytest 17.0392 562.583 3.33 169

🌳 CO2 Data:
City: Boydton, Lat: 36.6676, Lon: -78.3875
IP: 20.109.36.208
CO₂ from energy is: 0.200104036 g
CO₂ from manufacturing (embodied carbon) is: 0.051356485 g
Carbon Intensity for this location: 332 gCO₂eq/kWh
SCI: 0.251461 gCO₂eq / pipeline run emitted

Copy link

github-actions bot commented Nov 4, 2024

Eco-CI Output:

Label 🖥 avg. CPU utilization [%] 🔋 Total Energy [Joules] 🔌 avg. Power [Watts] Duration [Seconds]
Total Run (incl. overhead) 17.0872 629.756 3.26 193
checkout 7.52 3.54328 1.77 2
pip install uv wheel 7.61 3.54394 3.54 1
pip install requirements 67.026 32.3173 6.46 5
pytest 15.7285 590.351 3.26 181

🌳 CO2 Data:
City: Washington, Lat: 38.7095, Lon: -78.1539
IP: 40.76.117.196
CO₂ from energy is: 0.209078992 g
CO₂ from manufacturing (embodied carbon) is: 0.055065565 g
Carbon Intensity for this location: 332 gCO₂eq/kWh
SCI: 0.264145 gCO₂eq / pipeline run emitted

@mrchrisadams mrchrisadams merged commit b2b65f9 into master Nov 4, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant