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

setuptools is a requirement #593

Closed
daxm opened this issue Jan 16, 2024 · 7 comments · Fixed by #599
Closed

setuptools is a requirement #593

daxm opened this issue Jan 16, 2024 · 7 comments · Fixed by #599
Assignees
Labels
bug Something isn't working

Comments

@daxm
Copy link

daxm commented Jan 16, 2024

Describe the bug
Installing the polygon-api-client Python package does not cover all the underlying reqquirements. The 'setuptools' package is needed or from polygon import RESTClient will fail.

To Reproduce

  1. pip uninstall setuptools <-- Ensure you don't already have setuptools installed.
  2. pip install -U polygon-api-client <-- Ensure you have the most recent polygon-api-client package.
  3. Make a python file with from polygon import RESTClient in the file.
  4. Run the file and see the error.
  5. pip install setuptools
  6. Run the file and it will run fine.

Expected behavior
setuptools needs to be in the list of required packages in the published package on pypi for polygon-api-client.

Screenshots

/home/daxm/PycharmProjects/polygon.io/.venv/bin/python /home/daxm/PycharmProjects/polygon.io/main.py 
Traceback (most recent call last):
  File "/home/daxm/PycharmProjects/polygon.io/main.py", line 4, in <module>
    from polygon import RESTClient
  File "/home/daxm/PycharmProjects/polygon.io/.venv/lib/python3.12/site-packages/polygon/__init__.py", line 1, in <module>
    from .rest import RESTClient
  File "/home/daxm/PycharmProjects/polygon.io/.venv/lib/python3.12/site-packages/polygon/rest/__init__.py", line 1, in <module>
    from .aggs import AggsClient
  File "/home/daxm/PycharmProjects/polygon.io/.venv/lib/python3.12/site-packages/polygon/rest/aggs.py", line 1, in <module>
    from .base import BaseClient
  File "/home/daxm/PycharmProjects/polygon.io/.venv/lib/python3.12/site-packages/polygon/rest/base.py", line 9, in <module>
    import pkg_resources  # part of setuptools
    ^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'pkg_resources'
@daxm daxm added the bug Something isn't working label Jan 16, 2024
@justinpolygon
Copy link
Contributor

Thanks for reporting. I'll check this out.

@justinpolygon justinpolygon self-assigned this Jan 16, 2024
@justinpolygon
Copy link
Contributor

Ah! I see now. That is in the "docker run" section... which I wasn't using. I copy/pasted the docker-compose sections. Maybe an additional note in that section?

@daxm I don't think we mention docker anywhere. Are you using a tutorial? If so can you send me the link.

@daxm
Copy link
Author

daxm commented Jan 16, 2024

I deleted this message. Sorry, I'm working on two issues at the same time and posted my response to the other issue here. :-)

@bfoz
Copy link

bfoz commented Feb 13, 2024

Sorry to re-open a closed issue. I just ran into this myself and I need to rage for a sec.

Would it be possible to add setuptools as a proper dependency so that pip install will Just Work. The note in the README is nice, and might be helpful for new users, but it didn't keep me from wasting an hour trying to figure out why my CI pipeline was suddenly failing. If setuptools is a dependency, then it should be listed as such, rather than relying on distributions to magically have it.

FWIW, actions/setup-python@v5 doesn't install setuptools.

@justinpolygon
Copy link
Contributor

Yes, I'll update the readme @bfoz. I'm sorry about that. As you probably read here and in the associated #599 PR, we initially thought it was much more of an edge case, so we added it but really sounds like we should just merge those readme sections. I 100% understand what you're saying and I'll add a PR now,

@bfoz
Copy link

bfoz commented Feb 13, 2024

Thanks, I appreciate the quick response (do you ever take a break? 😀).

Updating the readme is nice, but it turns out that pip install can't read the readme, so it doesn't know that it needs to install setuptools in situations where it isn't already installed.

@justinpolygon
Copy link
Contributor

Yeah, I wonder if we can remove that dependancy. I'll explore the idea. That would be really nice.

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

Successfully merging a pull request may close this issue.

4 participants
@bfoz @daxm @justinpolygon and others