Skip to content

setup.py generated by --meta=setup option creates a package at the wrong level. #520

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

Closed
tedo-benchling opened this issue Oct 18, 2021 · 0 comments · Fixed by #521
Closed
Labels
🐞bug Something isn't working

Comments

@tedo-benchling
Copy link
Contributor

tedo-benchling commented Oct 18, 2021

Describe the bug
setup.py generated by --meta=setup option creates a package at the wrong level.

Let's say you have an API my_api:
open-python-client generate
Generated directory looks something like:

README.md                                         my_api_client.egg-info setup.py
my_api_client          pyproject.toml

The expectation is that you can do
from my_api_client import Client after the package is installed.

However you can only do
import Client

because of the way setup.py is generated.

To Reproduce
Steps to reproduce the behavior:

  1. Run openapi-python-client generate --path <path to your openapi.json file> --meta=setup
  2. cd into the generated directory
  3. pip install -e .
  4. cd to some other directory
  5. python -c 'from import <your_api>_client import Client' # this will fail with ModuleNotFoundError: No module named <your_api>_client

Expected behavior
In order to allow the install of multiple openapi based python clients you should have to specify the open api python package to get a client.

OpenAPI Spec File
Any open API json should create this issue.

Desktop (please complete the following information):

  • OS: mac os 11.6
  • Python Version: 3.6.9
  • openapi-python-client version: 0.10.5

Additional context
Add any other context about the problem here.

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
1 participant