<#2285 `venv create` no longer includes `--sources...
# github-notifications
c
#2285 `venv create` no longer includes `--sources-directory` contents when all files are nested Issue created by huonw It seems like there was a regression from 2.1.148 -> 2.1.149 with the behaviour of
venv create
with a
--pex-repository
that was created with `--sources-directory`: those sources aren't included in the final venv. Reproducer:
Copy code
cd $(mktemp -d)

# create our dummy file
mkdir -p source_files/foo
touch source_files/foo/bar.py # NB.1
# touch source_files/qux.py # NB.2

for version in v2.1.148 v2.1.149; do
    curl -s -L <https://github.com/pantsbuild/pex/releases/download/$version/pex> > pex-$version
    chmod +x pex-$version

    # NB.3
    ./pex-$version --output-file=repository-$version.pex --sources-directory=source_files

    # NB.4
    PEX_SCRIPT=pex3 ./pex-$version venv create --dest-dir=dest-$version --pex-repository=repository-$version.pex --layout=flat

    # what was included?
    tree dest-$version
done
Running that shows that the contents of the
dest-...
directory depends on the version, without the
bar.py
file when using v2.1.149, but should be the same:
Copy code
dest-v2.1.148
└── foo
    └── bar.py

1 directory, 1 file
dest-v2.1.149

0 directories, 0 files
Ablative studies: • uncommenting
NB.2
line (to have two files) passes (both versions have both
foo/bar.py
and
qux.py
) • replacing the
NB.1
with
NB.2
(to just
qux.py
at the top level) passes always using v2.1.148 on line
NB.3
(create the pex) and v2.1.149 on line
NB.4
(create the venv) passes • v2.1.149 for
NB.3
and v2.1.148 for
NB.4
fails • I think third-party dependencies work okay, but haven't confirmed in this reduced setting • This reproduces without
--layout
, but the output is simpler with
--layout=flat
(First observed in pantsbuild/pants#20149.) pantsbuild/pex