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

Packages included from a directory in the .gitignore are silently omitted from builds #9556

Closed
MaddyGuthridge opened this issue Jul 16, 2024 · 3 comments
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@MaddyGuthridge
Copy link

MaddyGuthridge commented Jul 16, 2024

Description

One of my projects uses a transpilation system to add things such as links to its documentation before building and publishing new versions. The output of this transpilation system is added to .gitignore, as it is intended to be created from the main source code before running poetry build. However, as a consequence, all of the packages which should be included in the build are ignored, with no warning that this has happened.

I believe that it is a good idea to give an error if all contents from a package listed in [tool.poetry].packages have been ignored, as this will help others avoid the same pitfall. I don't believe that making this an error will break any valid package builds, as I cannot think of any reason that a package would be explicitly included but then also entirely excluded simultaneously.

To reproduce

Bug is reproduced in this commit in the fl-studio-api-stubs library.

git clone [email protected]:IL-Group/FL-Studio-API-Stubs.git
cd FL-Studio-API-Stubs
git checkout 352275b3784c4d47e5d24547e8e5b90ccc697be0 # switch to affected commit
poetry install --no-root # install dependencies
poetry run python -m scripts.build_lib # build library
poetry install # install library
poetry build -vvv | grep build_lib # build wheel and sdist

Note that build_lib/ is contained in the .gitignore, meaning all files for all packages are ignored when building.

Workarounds

No workaround to the lack of warning, but the overall issue can be avoided by explicitly including desired files, as per this commit.

Poetry Installation Method

pipx

Operating System

Windows 11

Poetry Version

Poetry (version 1.8.3)

Poetry Configuration

cache-dir = "C:\\Users\\maddy\\AppData\\Local\\pypoetry\\Cache"
experimental.system-git-client = false
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.parallel = true
keyring.enabled = true
solver.lazy-wheel = true
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}\\virtualenvs"  # C:\Users\maddy\AppData\Local\pypoetry\Cache\virtualenvs
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}"
warnings.export = true

Python Sysconfig

Platform: "win-amd64"
Python version: "3.11"
Current installation scheme: "venv"

Paths: 
        data = "C:\Users\maddy\AppData\Local\pypoetry\Cache\virtualenvs\fl-studio-api-stubs-BR5-F8sp-py3.11"
        include = "C:\Users\maddy\AppData\Local\Programs\Python\Python311\Include"
        platinclude = "C:\Users\maddy\AppData\Local\Programs\Python\Python311\Include"
        platlib = "C:\Users\maddy\AppData\Local\pypoetry\Cache\virtualenvs\fl-studio-api-stubs-BR5-F8sp-py3.11\Lib\site-packages"
        platstdlib = "C:\Users\maddy\AppData\Local\pypoetry\Cache\virtualenvs\fl-studio-api-stubs-BR5-F8sp-py3.11\Lib"
        purelib = "C:\Users\maddy\AppData\Local\pypoetry\Cache\virtualenvs\fl-studio-api-stubs-BR5-F8sp-py3.11\Lib\site-packages"
        scripts = "C:\Users\maddy\AppData\Local\pypoetry\Cache\virtualenvs\fl-studio-api-stubs-BR5-F8sp-py3.11\Scripts"
        stdlib = "C:\Users\maddy\AppData\Local\Programs\Python\Python311\Lib"

Variables: 
        BINDIR = "C:\Users\maddy\AppData\Local\pypoetry\Cache\virtualenvs\fl-studio-api-stubs-BR5-F8sp-py3.11\Scripts"
        BINLIBDEST = "C:\Users\maddy\AppData\Local\pypoetry\Cache\virtualenvs\fl-studio-api-stubs-BR5-F8sp-py3.11\Lib"
        EXE = ".exe"
        EXT_SUFFIX = ".cp311-win_amd64.pyd"
        INCLUDEPY = "C:\Users\maddy\AppData\Local\Programs\Python\Python311\Include"
        LIBDEST = "C:\Users\maddy\AppData\Local\Programs\Python\Python311\Lib"
        TZPATH = ""
        VERSION = "311"
        VPATH = "..\.."
        abiflags = ""
        base = "C:\Users\maddy\AppData\Local\pypoetry\Cache\virtualenvs\fl-studio-api-stubs-BR5-F8sp-py3.11"
        exec_prefix = "C:\Users\maddy\AppData\Local\pypoetry\Cache\virtualenvs\fl-studio-api-stubs-BR5-F8sp-py3.11"
        installed_base = "C:\Users\maddy\AppData\Local\Programs\Python\Python311"
        installed_platbase = "C:\Users\maddy\AppData\Local\Programs\Python\Python311"
        platbase = "C:\Users\maddy\AppData\Local\pypoetry\Cache\virtualenvs\fl-studio-api-stubs-BR5-F8sp-py3.11"
        platlibdir = "DLLs"
        prefix = "C:\Users\maddy\AppData\Local\pypoetry\Cache\virtualenvs\fl-studio-api-stubs-BR5-F8sp-py3.11"
        projectbase = "C:\Users\maddy\AppData\Local\Programs\Python\Python311"
        py_version = "3.11.4"
        py_version_nodot = "311"
        py_version_nodot_plat = "311"
        py_version_short = "3.11"
        srcdir = "C:\Users\maddy\AppData\Local\Programs\Python\Python311"
        userbase = "C:\Users\maddy\AppData\Roaming\Python"

Poetry Runtime Logs

poetry.txt

@MaddyGuthridge MaddyGuthridge added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jul 16, 2024
@dimbleby
Copy link
Contributor

sdists are source distributions, it is correct that build artifacts should not be included in source distributions

if you want to get into built artifacts for your wheels then you are entering the undocumented and unsupported territory of #2740: which mostly works but you will have to work your way through it yourself.

please close

@MaddyGuthridge
Copy link
Author

Fair fair, any word on when build scripts will be stabilized?

@MaddyGuthridge MaddyGuthridge closed this as not planned Won't fix, can't repro, duplicate, stale Jul 16, 2024
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants