Closed aplzr closed 1 year ago
Hello! 👋 Thanks for opening your first issue here! ❤️ We will try to get back to you soon. 🚴🏽♂️
I think we should try to replace setuptools.pkg_resources
with importlib.resources
(which is part of the standard library) (as recommended here). Would that resolve your issue?
I think it should, as it's part of the standard library. I just checked, there's only one additional place where pkg_resources
is imported (https://github.com/mne-tools/mne-python/blob/main/mne/utils/misc.py#L443), so it should be a fairly easy thing to fix (assuming there are no other parts of setuptools
that are used somewhere in mne
).
I have no experience with Github pull requests (we're using Gitlab at my company) but I'm happy to read up on it and give it a try.
I have no experience with Github pull requests (we're using Gitlab at my company) but I'm happy to read up on it and give it a try.
please go for it!
While trying to set up my local environment according to https://mne.tools/stable/install/contributing.html I ran into a problem when installing the doc requirements. Not sure if this is relevant in the context of this issue (I will ignore this for the moment), but thought I'd mention it.
pzr@ols122 ~\development\mne-python main ❯ python -m pip install -r .\requirements_doc.txt
Collecting https://github.com/numpy/numpydoc/archive/main.zip (from -r .\requirements_doc.txt (line 3))
Downloading https://github.com/numpy/numpydoc/archive/main.zip
| 86.9 kB 174.9 kB/s 0:00:00
Preparing metadata (setup.py) ... done
Collecting https://github.com/pydata/pydata-sphinx-theme/archive/f367a58af33be362351686f1e207ea099f8e529e.zip (from -r .\requirements_doc.txt (line 4))
Downloading https://github.com/pydata/pydata-sphinx-theme/archive/f367a58af33be362351686f1e207ea099f8e529e.zip
/ 3.4 MB 584.2 kB/s 0:00:05
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [16 lines of output]
Traceback (most recent call last):
File "C:\Users\pzr\development\venv\mne-bugfix-38\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
main()
File "C:\Users\pzr\development\venv\mne-bugfix-38\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\Users\pzr\development\venv\mne-bugfix-38\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 149, in prepare_metadata_for_build_wheel
return hook(metadata_directory, config_settings)
File "C:\Users\pzr\AppData\Local\Temp\pip-build-env-el1y8v1d\overlay\Lib\site-packages\sphinx_theme_builder\__init__.py", line 80, in prepare_metadata_for_build_wheel
return _generate_metadata(project, destination=Path(metadata_directory))
File "C:\Users\pzr\AppData\Local\Temp\pip-build-env-el1y8v1d\overlay\Lib\site-packages\sphinx_theme_builder\_internal\distributions.py", line 132, in generate_metadata
(dist_info / "METADATA").write_text(project.get_metadata_file_contents())
File "C:\Users\pzr\AppData\Local\Programs\Python\Python38\lib\pathlib.py", line 1256, in write_text
return f.write(data)
File "C:\Users\pzr\AppData\Local\Programs\Python\Python38\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f4da' in position 4769: character maps to <undefined>
[end of output]
Exporting the environment variable PYTHONUTF8=1
before install should fix this. Windows doesn't like the fact that there are emoji in the README of our website theme
That worked, thanks!
Description of the problem
Without declaring
setuptools
as a dependency,mne
importspkg_resources
, which is a part ofsetuptools
, in at least one place:In my case this leads to the following problem: I have written a package that depends on
mne
and that I package withflit
, i.e. my package is fully independent ofsetuptools
. When I try to install my package (with theflit_core
build backend instead ofsetuptools
) I get the following error:The problem is solved by declaring
setuptools
as a dependency in my own package, which I would prefer not having to do for obvious reasons. I understand thatsetuptools
has been the de-facto standard for many years and that one could just assume that pretty much every package will be installed in an environment where it is present. But lately a lot of people have been moving away fromsetuptools
, so if you depend on it I think you should explicitly declare it as a dependency inmne
.Steps to reproduce
Write a package with a build backend other than
setuptools
and have it depend onmne
.Link to data
No response
Expected results
Package can be installed with build backend other than
setuptools
.Actual results
Package can't be installed.
Additional information
(This is on a Gitlab runner, so not sure how helpful this is)