Skip to content

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

Closed
@tedo-benchling

Description

@tedo-benchling

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐞bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions