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

pyfiglet version has hidden depedency that causes edr cli to fail for python versions > 3.11 #1773

Closed
jcarpenter12 opened this issue Jan 8, 2025 · 3 comments
Labels
Bug Something isn't working Triage 👀

Comments

@jcarpenter12
Copy link
Contributor

jcarpenter12 commented Jan 8, 2025

Describe the bug

pyfiglet version in elementary has a hidden dependency on setuptools on some versions of python (I believe > 3.11) that causes edr cli to fail with the following error message

ModuleNotFoundError: No module named 'pkg_resources'

This looks like it relates to this issue on pyfiglet repo here that has been fixed pwaller/pyfiglet#124

To Reproduce
Steps to reproduce the behavior:

(1) Clone repo

git clone https://github.com/elementary-data/elementary.git
cd elementary

(2) Create then activate a virtual environment using a python version above 3.11, for example using pyenv you could do the following

pyenv virtualenv 3.12.1 edr-issue
pyenv activate edr-issue

(3) Install requirements

pip install -r dev-requirements.txt
pip install -e .

(4) Run

edr

This should then return the error

Traceback (most recent call last):
  File "/Users/my_username/.pyenv/versions/elementary/bin/edr", line 5, in <module>
    from elementary.cli.cli import cli
  File "/Users/my_username/Repos/elementary/elementary/cli/cli.py", line 5, in <module>
    from pyfiglet import Figlet
  File "/Users/my_username/.pyenv/versions/3.12.1/envs/elementary/lib/python3.12/site-packages/pyfiglet/__init__.py", line 11, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'

Expected behavior

EDR command should run without failure and display elementary logo and a list of commands to get started

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • Elementary CLI (edr) version: 0.16.1
  • Elementary dbt package version: N/A
  • dbt version you're using: N/A
  • Data warehouse: N/A
  • Infrastructure details: Mac OS

Additional context
Add any other context about the problem here.

Would you be willing to contribute a fix for this issue?

Yes I have tested a fix for this that I will raise a PR for shortly

@jcarpenter12 jcarpenter12 added Bug Something isn't working Triage 👀 labels Jan 8, 2025
jcarpenter12 added a commit to jcarpenter12/elementary that referenced this issue Jan 8, 2025
@mi-volodin
Copy link

To add on top of the issue, actually usage of pkg_resources implicitly assume that setuptools are present in the environment (no explicit dependency currently stated). While it's not the case if, for example, uv is used to initiate the venv instead of pip.

haritamar added a commit that referenced this issue Feb 18, 2025
Co-authored-by: Itamar Hartstein <haritamar@gmail.com>
@haritamar
Copy link
Collaborator

Merged the fix, thanks for contributing @jcarpenter12 !

@jcarpenter12
Copy link
Contributor Author

Merged the fix, thanks for contributing @jcarpenter12 !

thank you @haritamar , do you happen to know out of interest whether this will be in the next release then? Not too much trouble as I currently have a work around to install setuptools in the env the ci uses but would like to remove it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Triage 👀
Projects
None yet
Development

No branches or pull requests

3 participants