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

default_prefix_* variables not coerced to values in winexe.py #748

Closed
2 tasks done
robbmcleod opened this issue Jan 15, 2024 · 2 comments · Fixed by #750
Closed
2 tasks done

default_prefix_* variables not coerced to values in winexe.py #748

robbmcleod opened this issue Jan 15, 2024 · 2 comments · Fixed by #750
Labels
locked [bot] locked due to inactivity type::bug describes erroneous operation, use severity::* to classify the type

Comments

@robbmcleod
Copy link

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

In the documentation, on Windows one is supposed to be able to suggest a package install directory via default_prefix, with the default being:

name: my_package
default_prefix: ${USERPROFILE}\${NAME}

However, if we use the above, the installer tries to install to ${USERPROFILE}\$my_package. I.e. it is not substituting %USERPROFILE% and the leading $ is also still present from ${NAME}.

default_prefix_all_users has a similar issue.

Tested on constructor 3.5 installed via conda-forge and master cloned from here.

Conda Info

active environment : base
    active env location : C:\Anaconda3\envs\constructor
            shell level : 5
       user config file : C:\Users\robbm\.condarc
 populated config files : C:\Users\robbm\.condarc
          conda version : 23.11.0
    conda-build version : not installed
         python version : 3.11.7.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=x86_64
                          __conda=23.11.0=0
                          __cuda=12.3=0
                          __win=0=0
       base environment : C:\Anaconda3\envs\constructor  (writable)
      conda av data dir : C:\Anaconda3\envs\constructor\etc\conda
  conda av metadata url : None
           channel URLs : https://repo.anaconda.com/pkgs/main/win-64
                          https://repo.anaconda.com/pkgs/main/noarch
                          https://repo.anaconda.com/pkgs/r/win-64
                          https://repo.anaconda.com/pkgs/r/noarch
                          https://repo.anaconda.com/pkgs/msys2/win-64
                          https://repo.anaconda.com/pkgs/msys2/noarch
                          https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : C:\Anaconda3\envs\constructor\pkgs
                          C:\Users\robbm\.conda\pkgs
                          C:\Users\robbm\AppData\Local\conda\conda\pkgs
       envs directories : C:\Anaconda3\envs\constructor\envs
                          C:\Users\robbm\.conda\envs
                          C:\Users\robbm\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/23.11.0 requests/2.31.0 CPython/3.11.7 Windows/10 Windows/10.0.19045 solver/libmamba conda-libmamba-solver/23.12.0 libmambapy/1.5.6
          administrator : False
             netrc file : None
           offline mode : False

Conda Config

==> C:\Users\robbm\.condarc <==
channels:
  - defaults
  - conda-forge

Conda list

# packages in environment at C:\Anaconda3\envs\constructor:
#
# Name                    Version                   Build  Channel
archspec                  0.2.1              pyhd3eb1b0_0    defaults
boltons                   23.0.0          py311haa95532_0    defaults
brotli-python             1.0.9           py311hd77b12b_7    defaults
bzip2                     1.0.8                he774522_0    defaults
ca-certificates           2023.12.12           haa95532_0    defaults
certifi                   2023.11.17      py311haa95532_0    defaults
cffi                      1.16.0          py311h2bbff1b_0    defaults
charset-normalizer        2.0.4              pyhd3eb1b0_0    defaults
colorama                  0.4.6           py311haa95532_0    defaults
conda                     23.11.0         py311haa95532_0    defaults
conda-libmamba-solver     23.12.0            pyhd3eb1b0_1    defaults
conda-package-handling    2.2.0           py311haa95532_0    defaults
conda-package-streaming   0.9.0           py311haa95532_0    defaults
conda-standalone          23.10.0              haa95532_1    defaults
console_shortcut          0.1.1                         4    defaults
constructor               3.6.0+1.gd934f13          pypi_0    pypi
cryptography              41.0.7          py311h89fc84f_0    defaults
distro                    1.8.0           py311haa95532_0    defaults
fmt                       9.1.0                h6d14046_0    defaults
freetype                  2.12.1               ha860e81_0    defaults
giflib                    5.2.1                h8cc25b3_3    defaults
idna                      3.4             py311haa95532_0    defaults
jinja2                    3.1.2           py311haa95532_0    defaults
jpeg                      9e                   h2bbff1b_1    defaults
jsonpatch                 1.32               pyhd3eb1b0_0    defaults
jsonpointer               2.1                pyhd3eb1b0_0    defaults
lerc                      3.0                  hd77b12b_0    defaults
libarchive                3.6.2                hb62f4d4_2    defaults
libcurl                   8.5.0                h86230a5_0    defaults
libdeflate                1.17                 h2bbff1b_1    defaults
libffi                    3.4.4                hd77b12b_0    defaults
libiconv                  1.16                 h2bbff1b_2    defaults
libmamba                  1.5.6                hcd6fe79_0    defaults
libmambapy                1.5.6           py311h77c03ed_0    defaults
libpng                    1.6.39               h8cc25b3_0    defaults
libsolv                   0.7.24               h23ce68f_0    defaults
libssh2                   1.10.0               he2ea4bf_2    defaults
libtiff                   4.5.1                hd77b12b_0    defaults
libwebp                   1.3.2                hbc33d0d_0    defaults
libwebp-base              1.3.2                h2bbff1b_0    defaults
libxml2                   2.10.4               h0ad7f3c_1    defaults
lz4-c                     1.9.4                h2bbff1b_0    defaults
markupsafe                2.1.3           py311h2bbff1b_0    defaults
menuinst                  2.0.1           py311hd77b12b_1    defaults
nsis                      3.08                 h0ddc74d_1    defaults
openjpeg                  2.4.0                h4fc8c34_0    defaults
openssl                   3.0.12               h2bbff1b_0    defaults
packaging                 23.1            py311haa95532_0    defaults
pcre2                     10.42                h0ff8eda_0    defaults
pillow                    10.0.1          py311h045eedc_0    defaults
pip                       23.3.1          py311haa95532_0    defaults
platformdirs              3.10.0          py311haa95532_0    defaults
pluggy                    1.0.0           py311haa95532_1    defaults
pybind11-abi              4                    hd3eb1b0_1    defaults
pycosat                   0.6.6           py311h2bbff1b_0    defaults
pycparser                 2.21               pyhd3eb1b0_0    defaults
pyopenssl                 23.2.0          py311haa95532_0    defaults
pysocks                   1.7.1           py311haa95532_0    defaults
python                    3.11.7               he1021f5_0    defaults
reproc                    14.2.4               hd77b12b_1    defaults
reproc-cpp                14.2.4               hd77b12b_1    defaults
requests                  2.31.0          py311haa95532_0    defaults
ruamel.yaml               0.17.21         py311h2bbff1b_0    defaults
setuptools                68.2.2          py311haa95532_0    defaults
sqlite                    3.41.2               h2bbff1b_0    defaults
tk                        8.6.12               h2bbff1b_0    defaults
tqdm                      4.65.0          py311h746a85d_0    defaults
truststore                0.8.0           py311haa95532_0    defaults
tzdata                    2023d                h04d1e81_0    defaults
urllib3                   1.26.18         py311haa95532_0    defaults
vc                        14.2                 h21ff451_1    defaults
vs2015_runtime            14.27.29016          h5e58377_2    defaults
wheel                     0.41.2          py311haa95532_0    defaults
win_inet_pton             1.1.0           py311haa95532_0    defaults
xz                        5.4.5                h8cc25b3_0    defaults
yaml-cpp                  0.8.0                hd77b12b_0    defaults
zlib                      1.2.13               h8cc25b3_0    defaults
zstandard                 0.19.0          py311h2bbff1b_0    defaults
zstd                      1.5.5                hd43e919_0    defaults

Additional Context

No response

@robbmcleod robbmcleod added the type::bug describes erroneous operation, use severity::* to classify the type label Jan 15, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in 🧭 Planning Jan 15, 2024
@jaimergp
Copy link
Contributor

I'm not sure string interpolation is supposed to work in those keys. The documentation might be just using that syntax to say "the value of your user profile directory followed by the value of the name of the installer", but that doesn't mean that you can use those variables for other constructions.

'DEFAULT_PREFIX': info.get('default_prefix', join('%USERPROFILE%', name.lower())),
'DEFAULT_PREFIX_DOMAIN_USER': info.get('default_prefix_domain_user',
join('%LOCALAPPDATA%', name.lower())),
'DEFAULT_PREFIX_ALL_USERS': info.get('default_prefix_all_users',
join('%ALLUSERSPROFILE%', name.lower())),

You can however use %ENV_VAR% syntax which will be rendered at install time. Probably safe to stick to system-defined environment variables.

We can add a note to the documentation to make sure this is clear.

@jaimergp
Copy link
Contributor

See #750 for extra clarification

@github-project-automation github-project-automation bot moved this from 🆕 New to 🏁 Done in 🧭 Planning Feb 6, 2024
@github-actions github-actions bot added the locked [bot] locked due to inactivity label Aug 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity type::bug describes erroneous operation, use severity::* to classify the type
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants