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

Move source subdir #24

Merged
merged 3 commits into from
Nov 15, 2021
Merged

Conversation

abadger
Copy link
Contributor

@abadger abadger commented May 21, 2020

Move source of ansibulled to a subdir.

pyre prefers to be given the directory which holds your python package
as the source-directory rather than the directory which is your python
package. However, if the directory given is the toplevel, pyre tends to
get slow for me. (I believe since it scans temporary directories that
I have accumulated [downloads of all those ansible collections...]).
Putting the soure code in its own subdirectory is the way to fix that.

@abadger abadger force-pushed the move-source-subdir branch 2 times, most recently from 43e7d3b to c5d89cb Compare May 21, 2020 07:54
@abadger
Copy link
Contributor Author

abadger commented May 21, 2020

I think we're stuck for now with this: python-poetry/poetry#1811

I might be able to work around it by moving the test directory into src/ as well but I'd like to hold off and see if poetry fixes that first. The poetry bug breaks poetry install but poetry build still works.

@abadger
Copy link
Contributor Author

abadger commented May 21, 2020

Our case is slightly different from the one reported before. I opened a second bug here: python-poetry/poetry#2450 I think that with the current code, a fix for either one of the two bugs will fix our usage.

@abadger abadger changed the base branch from master to main June 19, 2020 04:20
@gundalow
Copy link
Contributor

I see there is a WIP PR at python-poetry/poetry-core#108 wonder if that helps

@abadger abadger force-pushed the move-source-subdir branch 3 times, most recently from 63af5e1 to 66d8f3f Compare November 14, 2021 22:23
@abadger
Copy link
Contributor Author

abadger commented Nov 14, 2021

Hey @felixfontein , I don't know if you still want this; the slowdown only happens if pyre (or another tool) ends up scanning directories of python code that might get created in the toplevel (When I first noticed it, I had an ansible_collection directory somewhere in my source tree because I ran antsibull-build with the checkout as the destination or something).

I just completed this since upstream for poetry said they had fixed the bug and I wanted to test that for them.

(If you don't want to move the source dir, you may still want to cherry-pick the first commit here. That moves from using poetry to poetry-core for the build-system in pyproject.toml. Doing that should mean that pip install antsibull won't have to install all of poetry and its dependencies anymore)

poetry has been split into poetry and poetry-core.  The core is a small
subset of functionality that is what is necessary to build python
packages.  Changing from poetry to poetry-core should improve the
`pip install antsibull` experience since all of poetry and its
dependencis won't be needed.

The update to a newer version is also needed to solve:

> python-poetry/poetry#2450

and allow us to put the source in a subdirectory
pyre prefers to be given the directory which holds your python package
as the source-directory rather than the directory which is your python
package.  However, if the directory given is the toplevel, pyre tends to
get slow for me.  (I believe since it scans temporary directories that
I have accumulated [downloads of all those ansible collections...]).
Putting the source code in its own subdirectory is the way to fix that.
@felixfontein
Copy link
Collaborator

@abadger thanks a lot for finishing this PR! I'll definitely merge this :) (just merged something else first and then rebased)

@felixfontein felixfontein merged commit 430bd7b into ansible-community:main Nov 15, 2021
@abadger
Copy link
Contributor Author

abadger commented Nov 15, 2021 via email

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

Successfully merging this pull request may close these issues.

3 participants