Skip to content

[BUG] Failed to build tarball on pypi for referencing README.md outside source dir #123

@hyx0329

Description

@hyx0329

Describe the bug

The python build script is referencing README.md in parent directory, outside the source directory. This behavior will cause FileNotFoundError when building from source tarball.

xoscar/python/setup.py

Lines 132 to 137 in 4df7631

# build long description
def build_long_description():
readme_path = os.path.join(os.path.dirname(os.path.abspath(repo_root)), "README.md")
with open(readme_path, encoding="utf-8") as f:
return f.read()

xoscar/python/setup.py

Lines 384 to 390 in 4df7631

setup_options = dict(
version=versioneer.get_version(),
ext_modules=extensions + [XoscarCmakeExtension("xoscar_pygloo")],
cmdclass={"build_ext": CMakeBuild},
long_description=build_long_description(),
long_description_content_type="text/markdown",
)

To Reproduce

  • Python 3.13
  • venv with python -m venv .venv
  • in venv run pip install xoscar==0.4.6

Got:

FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-q2lllpc4/README.md'

Expected behavior

No installation error.

Additional context

There's no prebuilt packages for py3.13, so pip falls back to building from source.

Building directly from latest code repository is fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions