Skip to content

Conversation

@purarue
Copy link
Owner

@purarue purarue commented Sep 6, 2025

No description provided.

@purarue
Copy link
Owner Author

purarue commented Sep 6, 2025

it seems that without something like

cat /home/username/.local/lib/python3.13/site-packages/_00__force_editable_order.pth

/home/username/Repos/HPI-personal
/home/username/Repos/HPI
/home/username/Repos/HPI-karlicoss/src

my.location.all will use the one from HPI-karlicoss despite me having the __path__ like suggested in purarue/google_takeout_parser#90

will have to do more testing, not sure if I just have extra editble.pth files, if Im using --use-pep517 everywhere etc.

@purarue
Copy link
Owner Author

purarue commented Sep 9, 2025

using this for now, will disable __init__.py and play with it at some point in the future

@purarue purarue closed this Sep 9, 2025
purarue added a commit to purarue/HPI-personal that referenced this pull request Sep 9, 2025
@karlicoss
Copy link
Contributor

karlicoss commented Sep 9, 2025

Hmm this is surprising!
I just did an experiment with your repos. Checked via the following snippet

import my.location as L
print(L.__path__)
import my.location.all as LA
print(LA.__file__)
  • when using your repo as the last in config:

    $ cat /code/hpi_private/src/my/__init__.py
    __path__[:] = [
        "/code/hpi_private/src/my",
        "/code/hpi_overlay/src/my",
        "/code/hpi/src/my",
        "/code/HPI-purarue-personal/my",
        "/code/HPI_purarue/my",
    
    ]
    
    _NamespacePath(['/code/hpi/src/my/location', '/code/HPI-purarue-personal/my/location', '/code/HPI_purarue/my/location'])
    /code/hpi/src/my/location/all.py
    

    As expected

    • __path__ ordering for my.location is correct
    • all.py is imported from my repo.
  • when using your 'personal' repo as the first one in list:

    $ cat /code/hpi_private/src/my/__init__.py
    __path__[:] = [
        "/code/HPI-purarue-personal/my",
        "/code/hpi_private/src/my",
        "/code/hpi_overlay/src/my",
        "/code/hpi/src/my",
        "/code/HPI_purarue/my",
    ]
    
    _NamespacePath(['/code/HPI-purarue-personal/my/location', '/code/hpi/src/my/location'])
    /code/HPI-purarue-personal/my/location/all.py
    
    • import order is as expected, your repo goes first
    • all.py is from your personal repo!

Wonder what's different between our setups...
Here's what my relevant portion of virtualenv looks like in case it helps.

$ ls -al | grep -i hpi 
-rw-r--r--   1 karlicos karlicos    4962 Sep 10 00:42 __editable___hpi_purarue_0_0_1_finder.py
-rw-r--r--   1 karlicos karlicos      93 Sep 10 00:42 __editable__.hpi_purarue-0.0.1.pth
-rw-r--r--   1 karlicos karlicos    3549 Sep 10 00:42 __editable___hpi_purarue_personal_0_0_1_finder.py
-rw-r--r--   1 karlicos karlicos     111 Sep 10 00:42 __editable__.hpi_purarue_personal-0.0.1.pth
drwxr-xr-x   3 karlicos karlicos    4096 Jul 29 00:08 hpi-0.6.20250624.dev11+dirty.dist-info
drwxr-xr-x   2 karlicos karlicos    4096 Jul 29 00:08 hpi_overlay-0.1.dev39+g2d18aed.d20250728.dist-info
-rw-r--r--   2 karlicos karlicos      21 Jul 29 00:08 _hpi_overlay.pth
drwxr-xr-x   2 karlicos karlicos    4096 Jul 29 00:08 hpi_private-0.1.dev201+gbebaa1a.d20250728.dist-info
-rw-r--r--   2 karlicos karlicos      21 Jul 29 00:08 _hpi_private.pth
-rw-r--r--   2 karlicos karlicos      13 Jul 29 00:08 _hpi.pth
drwxr-xr-x   3 karlicos karlicos    4096 Sep 10 00:42 hpi_purarue-0.0.1.dist-info
drwxr-xr-x   2 karlicos karlicos    4096 Sep 10 00:42 hpi_purarue_personal-0.0.1.dist-info

There are a bunch of other .pth files, but they all are from other projects installed in editable mode, I haven't used reorder_editable in this virtualenv at all!

@purarue
Copy link
Owner Author

purarue commented Sep 10, 2025

Thanks for the exploration, I will try creating a virtualenv and testing this when I have some time -- thanks 👍

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