Skip to content

fix: setup.py should generate importable packages named <project>_client (closes #520) #521

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

Merged
merged 1 commit into from
Oct 25, 2021

Conversation

tedo-benchling
Copy link
Contributor

In order to allow multiple clients generated to be installed via setup.py, update the generated setup.py file so that the package installed is available to clients as
from <my_api>_client import Client
rather than just
import Client

This is accomplished by specifying packages=["{{package_name}}"] in the setup.py.jinja2 file and removing the package_dir={"": "{{ package_name }}"}, directive.

@dbanty
Copy link
Collaborator

dbanty commented Oct 22, 2021

Thanks for the fix! @Leem0sh does this fix #492?

@codecov
Copy link

codecov bot commented Oct 25, 2021

Codecov Report

Merging #521 (8459c8a) into main (2c157aa) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #521   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           48        48           
  Lines         1639      1639           
=========================================
  Hits          1639      1639           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2c157aa...8459c8a. Read the comment docs.

@dbanty
Copy link
Collaborator

dbanty commented Oct 25, 2021

Some cursory testing tells me that this does fix #492. Though, admittedly, I don't really understand setup.py because I never use it 😅. So I'm mostly just assuming that @tedo-benchling is doing the right thing and that having the package name be in the generated lib is the correct behavior. Thanks for this fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants