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

Remove disused reference to distutils.debug #159

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

koen-vg
Copy link
Contributor

@koen-vg koen-vg commented Apr 26, 2024

Distutils has been removed from the standard library in python 3.12. If you try to install powerplantmatching in a clean environment with python 3.12 right now, you get:

koen-uit-desktop · powerplantmatching > source .venv/bin/activate   
(.venv) koen-uit-desktop · powerplantmatching > pip install -e .      
[...]
(.venv) koen-uit-desktop · powerplantmatching > python              
Python 3.12.2 (main, Feb 21 2024, 00:00:00) [GCC 14.0.1 20240217 (Red Hat 14.0.1-0)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import powerplantmatching as pm
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/koen/Dokument/UiT/Research/Modelling/powerplantmatching/powerplantmatching/__init__.py", line 38, in <module>
    from . import core, data, heuristics, plot, utils
  File "/home/koen/Dokument/UiT/Research/Modelling/powerplantmatching/powerplantmatching/data.py", line 25, in <module>
    from distutils.log import debug
ModuleNotFoundError: No module named 'distutils'

No problem: the offending line of code is unnecessary anyway as the debug function is never used anywhere!

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other

Checklist

  • I have added a note to release notes doc/release_notes.rst.
  • I have used pre-commit run --all to lint/format/check my contribution
  • I have documented the effects of my code changes in the documentation doc/.
  • I have adjusted the docstrings in the code appropriately.

Distutils has been removed from the standard library in python 3.12
@koen-vg
Copy link
Contributor Author

koen-vg commented Apr 26, 2024

A bit silly of me that I didn't submit this PR earlier cause I found the bug a little while ago; could have made it into 0.5.13. Oh well, next release.

@fneum
Copy link
Member

fneum commented Apr 30, 2024

No problem, I'll just do another one.

@fneum fneum merged commit 7a933ae into PyPSA:master Apr 30, 2024
2 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.

2 participants