conda / conda-build

Commands and tools for building conda packages
https://docs.conda.io/projects/conda-build/
Other
380 stars 420 forks source link

setup.py build documentation/implemantation for windows uses deprecated python setup.py install #5311

Open ReimarBauer opened 5 months ago

ReimarBauer commented 5 months ago

Checklist

What happened?

in the https://docs.conda.io/projects/conda-build/en/stable/user-guide/tutorials/build-pkgs.html#writing-the-build-script-files-build-sh-and-bld-bat

you describe

"%PYTHON%" setup.py install if errorlevel 1 exit 1

but that call is deprecated, https://packaging.python.org/en/latest/discussions/setup-py-deprecated/

I am not sure if only the documentation has it old style. Please have a look.

In linux new style works, in windows not.

Conda Info

active environment : base
    active env location : C:\Users\user\miniforge
            shell level : 1
       user config file : C:\Users\user\.condarc
 populated config files : C:\Users\user\miniforge\.condarc
                          C:\Users\user\.condarc
          conda version : 24.3.0
    conda-build version : 24.3.0
         python version : 3.10.14.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=x86_64_v3
                          __conda=24.3.0=0
                          __win=0=0
       base environment : C:\Users\user\miniforge  (writable)
      conda av data dir : C:\Users\user\miniforge\etc\conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          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
          package cache : C:\Users\user\miniforge\pkgs
                          C:\Users\user\.conda\pkgs
                          C:\Users\user\AppData\Local\conda\conda\pkgs
       envs directories : C:\Users\user\miniforge\envs
                          C:\Users\user\.conda\envs
                          C:\Users\user\AppData\Local\conda\conda\envs
               platform : win-64
             user-agent : conda/24.3.0 requests/2.31.0 CPython/3.10.14 Windows/10 Windows/10.0.14393 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.8
          administrator : False
             netrc file : None
           offline mode : False

Conda Config

Conda list


## Package Plan ##

  environment location: C:\Users\user\miniforge\conda-bld\mss_1714996915129\_test_env

The following NEW packages will be INSTALLED:

    abmss:                   alpha-py310_1000              local
    alembic:                 1.13.1-pyhd8ed1ab_1           conda-forge
    appdirs:                 1.4.4-pyh9f0ad1d_0            conda-forge
    argon2-cffi:             23.1.0-pyhd8ed1ab_0           conda-forge
    argon2-cffi-bindings:    21.2.0-py310h8d17308_4        conda-forge
    backports:               1.0-pyhd8ed1ab_3              conda-forge
    backports.tarfile:       1.0.0-pyhd8ed1ab_1            conda-forge
    basemap:                 1.4.1-np126py310h507904d_0    conda-forge
    basemap-data:            1.3.2-pyhd8ed1ab_3            conda-forge
    bcrypt:                  4.1.2-py310h87d50f1_0         conda-forge
    bidict:                  0.23.1-pyhd8ed1ab_0           conda-forge
    blinker:                 1.8.1-pyhd8ed1ab_0            conda-forge
    blosc:                   1.21.5-hbd69f2e_1             conda-forge
    brotli:                  1.1.0-hcfcfb64_1              conda-forge
    brotli-bin:              1.1.0-hcfcfb64_1              conda-forge
    brotli-python:           1.1.0-py310h00ffb61_1         conda-forge
    bzip2:                   1.0.8-hcfcfb64_5              conda-forge
    ca-certificates:         2024.2.2-h56e8100_0           conda-forge
    cachetools:              5.3.3-pyhd8ed1ab_0            conda-forge
    cartopy:                 0.23.0-py310hecd3228_0        conda-forge
    certifi:                 2024.2.2-pyhd8ed1ab_0         conda-forge
    cffi:                    1.16.0-py310h8d17308_0        conda-forge
    cftime:                  1.6.3-py310h3e78b6c_0         conda-forge
    chameleon:               3.9.1-pyhd8ed1ab_0            conda-forge
    charset-normalizer:      3.3.2-pyhd8ed1ab_0            conda-forge
    click:                   8.1.7-win_pyh7428d3b_0        conda-forge
    colorama:                0.4.6-pyhd8ed1ab_0            conda-forge
    contourpy:               1.2.1-py310h232114e_0         conda-forge
    cryptography:            42.0.6-py310h25a5809_0        conda-forge
    cycler:                  0.12.1-pyhd8ed1ab_0           conda-forge
    dataclasses:             0.8-pyhc8e2a94_3              conda-forge
    defusedxml:              0.7.1-pyhd8ed1ab_0            conda-forge
    dnspython:               2.6.1-pyhd8ed1ab_1            conda-forge
    elementpath:             4.4.0-pyhd8ed1ab_0            conda-forge
    email-validator:         2.1.1-pyhd8ed1ab_0            conda-forge
    email_validator:         2.1.1-hd8ed1ab_0              conda-forge
    execnet:                 2.1.1-pyhd8ed1ab_0            conda-forge
    fastkml:                 0.12-pyhd8ed1ab_0             conda-forge
    flask:                   2.3.3-pyhd8ed1ab_0            conda-forge
    flask-cors:              4.0.0-pyhd8ed1ab_0            conda-forge
    flask-httpauth:          4.8.0-pyhd8ed1ab_0            conda-forge
    flask-login:             0.6.3-pyhd8ed1ab_1            conda-forge
    flask-mail:              0.9.1-py_2                    conda-forge
    flask-migrate:           4.0.7-pyhd8ed1ab_0            conda-forge
    flask-socketio:          5.3.6-pyhd8ed1ab_0            conda-forge
    flask-sqlalchemy:        3.0.3-pyhd8ed1ab_0            conda-forge
    flask-wtf:               1.2.1-pyhd8ed1ab_0            conda-forge
    fonttools:               4.51.0-py310h8d17308_0        conda-forge
    freetype:                2.12.1-hdaf720e_2             conda-forge
    fs:                      2.4.16-pyhd8ed1ab_0           conda-forge
    fs.sshfs:                1.0.2-pyhd8ed1ab_0            conda-forge
    fs.webdavfs:             0.4.2-pyhd8ed1ab_0            conda-forge
    fs_filepicker:           0.3.7-pyhd8ed1ab_5            conda-forge
    future:                  1.0.0-pyhd8ed1ab_0            conda-forge
    geos:                    3.12.1-h1537add_0             conda-forge
    gettext:                 0.22.5-h5728263_2             conda-forge
    gettext-tools:           0.22.5-h7d00a51_2             conda-forge
    git:                     2.45.0-h57928b3_1             conda-forge
    gitdb:                   4.0.11-pyhd8ed1ab_0           conda-forge
    gitpython:               3.1.43-pyhd8ed1ab_0           conda-forge
    glib:                    2.80.0-h39d0aa6_6             conda-forge
    glib-tools:              2.80.0-h0a98069_6             conda-forge
    gpxpy:                   1.6.2-pyhd8ed1ab_0            conda-forge
    greenlet:                3.0.3-py310h00ffb61_0         conda-forge
    gst-plugins-base:        1.18.5-he07aa86_3             conda-forge
    gstreamer:               1.18.5-hdff456e_3             conda-forge
    h11:                     0.14.0-pyhd8ed1ab_0           conda-forge
    hdf4:                    4.2.15-h1b1b6ef_5             conda-forge
    hdf5:                    1.14.3-nompi_h73e8ff5_101     conda-forge
    humanfriendly:           10.0-py310h5588dad_5          conda-forge
    icu:                     58.2-ha925a31_3
    idna:                    3.7-pyhd8ed1ab_0              conda-forge
    importlib-metadata:      7.1.0-pyha770c72_0            conda-forge
    importlib-resources:     6.4.0-pyhd8ed1ab_0            conda-forge
    importlib_metadata:      7.1.0-hd8ed1ab_0              conda-forge
    importlib_resources:     6.4.0-pyhd8ed1ab_0            conda-forge
    intel-openmp:            2024.1.0-h57928b3_965         conda-forge
    isodate:                 0.6.1-pyhd8ed1ab_0            conda-forge
    itsdangerous:            2.2.0-pyhd8ed1ab_0            conda-forge
    jaraco.classes:          3.4.0-pyhd8ed1ab_1            conda-forge
    jaraco.context:          5.3.0-pyhd8ed1ab_1            conda-forge
    jaraco.functools:        4.0.0-pyhd8ed1ab_0            conda-forge
    jinja2:                  3.1.3-pyhd8ed1ab_0            conda-forge
    jpeg:                    9e-hcfcfb64_3                 conda-forge
    jplephem:                2.21-pyh864a33b_0             conda-forge
    keyring:                 25.2.0-pyh7428d3b_0           conda-forge
    kiwisolver:              1.4.5-py310h232114e_1         conda-forge
    krb5:                    1.21.2-heb0366b_0             conda-forge
    lcms2:                   2.14-h90d422f_0               conda-forge
    lerc:                    4.0.0-h63175ca_0              conda-forge
    libaec:                  1.1.3-h63175ca_0              conda-forge
    libasprintf:             0.22.5-h5728263_2             conda-forge
    libasprintf-devel:       0.22.5-h5728263_2             conda-forge
    libblas:                 3.9.0-22_win64_mkl            conda-forge
    libbrotlicommon:         1.1.0-hcfcfb64_1              conda-forge
    libbrotlidec:            1.1.0-hcfcfb64_1              conda-forge
    libbrotlienc:            1.1.0-hcfcfb64_1              conda-forge
    libcblas:                3.9.0-22_win64_mkl            conda-forge
    libclang:                12.0.1-default_h81446c8_4     conda-forge
    libcurl:                 8.7.1-hd5e4a3a_0              conda-forge
    libdeflate:              1.14-hcfcfb64_0               conda-forge
    libffi:                  3.4.2-h8ffe710_5              conda-forge
    libgettextpo:            0.22.5-h5728263_2             conda-forge
    libgettextpo-devel:      0.22.5-h5728263_2             conda-forge
    libglib:                 2.80.0-h39d0aa6_6             conda-forge
    libhwloc:                2.10.0-default_h2fffb23_1000  conda-forge
    libiconv:                1.17-hcfcfb64_2               conda-forge
    libintl:                 0.22.5-h5728263_2             conda-forge
    libintl-devel:           0.22.5-h5728263_2             conda-forge
    liblapack:               3.9.0-22_win64_mkl            conda-forge
    libnetcdf:               4.9.2-nompi_h07c049d_113      conda-forge
    libogg:                  1.3.4-h8ffe710_1              conda-forge
    libpng:                  1.6.43-h19919ed_0             conda-forge
    libpq:                   16.2-hdb24f17_1               conda-forge
    libsqlite:               3.45.3-hcfcfb64_0             conda-forge
    libssh2:                 1.11.0-h7dfc565_0             conda-forge
    libtiff:                 4.4.0-hc4f729c_5              conda-forge
    libvorbis:               1.3.7-h0e60522_0              conda-forge
    libwebp-base:            1.4.0-hcfcfb64_0              conda-forge
    libxcb:                  1.13-hcd874cb_1004            conda-forge
    libxml2:                 2.12.6-hc3477c8_2             conda-forge
    libxslt:                 1.1.39-h3df6e99_0             conda-forge
    libzip:                  1.10.1-h1d365fa_3             conda-forge
    libzlib:                 1.2.13-hcfcfb64_5             conda-forge
    lxml:                    5.2.1-py310hdccf185_0         conda-forge
    lz4-c:                   1.9.4-hcfcfb64_0              conda-forge
    m2w64-gcc-libgfortran:   5.3.0-6                       conda-forge
    m2w64-gcc-libs:          5.3.0-7                       conda-forge
    m2w64-gcc-libs-core:     5.3.0-7                       conda-forge
    m2w64-gmp:               6.1.0-2                       conda-forge
    m2w64-libwinpthread-git: 5.0.0.4634.697f757-2          conda-forge
    mako:                    1.3.3-pyhd8ed1ab_0            conda-forge
    markdown:                3.6-pyhd8ed1ab_0              conda-forge
    markupsafe:              2.1.5-py310h8d17308_0         conda-forge
    matplotlib:              3.8.4-py310h5588dad_0         conda-forge
    matplotlib-base:         3.8.4-py310hc9baf74_0         conda-forge
    metpy:                   1.6.2-pyhd8ed1ab_0            conda-forge
    mkl:                     2024.1.0-h66d3029_692         conda-forge
    more-itertools:          10.2.0-pyhd8ed1ab_0           conda-forge
    msys2-conda-epoch:       20160418-1                    conda-forge
    multidict:               6.0.5-py310h8d17308_0         conda-forge
    munkres:                 1.1.4-pyh9f0ad1d_0            conda-forge
    netcdf4:                 1.6.5-nompi_py310h6477780_100 conda-forge
    numpy:                   1.26.4-py310hf667824_0        conda-forge
    openjpeg:                2.5.0-hc9384bd_1              conda-forge
    openssl:                 3.3.0-hcfcfb64_0              conda-forge
    owslib:                  0.30.0-pyhd8ed1ab_0           conda-forge
    packaging:               24.0-pyhd8ed1ab_0             conda-forge
    pandas:                  2.2.2-py310hecd3228_0         conda-forge
    paramiko:                3.4.0-pyhd8ed1ab_0            conda-forge
    passlib:                 1.7.4-pyhd8ed1ab_1            conda-forge
    pcre2:                   10.43-h17e33f8_0              conda-forge
    pillow:                  9.2.0-py310hd4fb230_3         conda-forge
    pint:                    0.23-pyhd8ed1ab_0             conda-forge
    pip:                     24.0-pyhd8ed1ab_0             conda-forge
    platformdirs:            4.2.1-pyhd8ed1ab_0            conda-forge
    pooch:                   1.8.1-pyhd8ed1ab_0            conda-forge
    proj:                    9.3.1-ha107b6e_0
    property-cached:         1.6.4-py_0                    conda-forge
    psycopg2:                2.9.9-py310h20e1e1d_0         conda-forge
    pthread-stubs:           0.4-hcd874cb_1001             conda-forge
    pthreads-win32:          2.9.1-hfa6e2cd_3              conda-forge
    pycountry:               22.3.5-pyhd8ed1ab_0           conda-forge
    pycparser:               2.22-pyhd8ed1ab_0             conda-forge
    pygeoif:                 0.7-py_1                      conda-forge
    pyjwt:                   2.8.0-pyhd8ed1ab_1            conda-forge
    pymysql:                 1.1.0-pyhd8ed1ab_0            conda-forge
    pynacl:                  1.5.0-py310h635b8f1_3         conda-forge
    pyopenssl:               24.0.0-pyhd8ed1ab_0           conda-forge
    pyparsing:               3.1.2-pyhd8ed1ab_0            conda-forge
    pyproj:                  3.6.1-py310h05d47c7_5         conda-forge
    pyqt:                    5.15.4-py310h8a704f9_0        conda-forge
    pyqt5-sip:               12.9.0-py310h8a704f9_0        conda-forge
    pyreadline3:             3.4.1-py310h5588dad_3         conda-forge
    pysaml2:                 7.5.0-pyhd8ed1ab_0            conda-forge
    pyshp:                   2.3.1-pyhd8ed1ab_0            conda-forge
    pysocks:                 1.7.1-pyh0701188_6            conda-forge
    python:                  3.10.14-h4de0772_0_cpython    conda-forge
    python-dateutil:         2.9.0-pyhd8ed1ab_0            conda-forge
    python-engineio:         4.8.2-pyhd8ed1ab_0            conda-forge
    python-slugify:          8.0.4-pyhd8ed1ab_0            conda-forge
    python-socketio:         5.11.2-pyhd8ed1ab_0           conda-forge
    python-tzdata:           2024.1-pyhd8ed1ab_0           conda-forge
    python_abi:              3.10-4_cp310                  conda-forge
    pytz:                    2024.1-pyhd8ed1ab_0           conda-forge
    pywin32-ctypes:          0.2.2-py310h5588dad_1         conda-forge
    pyyaml:                  6.0.1-py310h8d17308_1         conda-forge
    qt:                      5.15.7-haa95532_0
    qt-main:                 5.15.2-he8e5bd7_7
    qt-webengine:            5.15.9-h5bd16bc_7
    requests:                2.31.0-pyhd8ed1ab_0           conda-forge
    scipy:                   1.13.0-py310h46043a1_1        conda-forge
    setuptools:              69.5.1-pyhd8ed1ab_0           conda-forge
    sgp4:                    2.22-py310h220cb41_0          conda-forge
    shapely:                 2.0.4-py310hacc03b5_0         conda-forge
    simple-websocket:        1.0.0-pyhd8ed1ab_1            conda-forge
    sip:                     6.5.1-py310h8a704f9_2         conda-forge
    six:                     1.16.0-pyh6c4a22f_0           conda-forge
    skyfield:                1.48-pyhca7485f_0             conda-forge
    skyfield-data:           5.0.0-pyhd8ed1ab_0            conda-forge
    smmap:                   5.0.0-pyhd8ed1ab_0            conda-forge
    snappy:                  1.2.0-hfb803bf_1              conda-forge
    sniffio:                 1.3.1-pyhd8ed1ab_0            conda-forge
    sqlalchemy:              2.0.30-py310ha8f682b_0        conda-forge
    sqlite:                  3.45.3-hcfcfb64_0             conda-forge
    tbb:                     2021.12.0-h91493d7_0          conda-forge
    text-unidecode:          1.3-pyhd8ed1ab_1              conda-forge
    tk:                      8.6.13-h5226925_1             conda-forge
    toml:                    0.10.2-pyhd8ed1ab_0           conda-forge
    tornado:                 6.4-py310h8d17308_0           conda-forge
    traitlets:               5.14.3-pyhd8ed1ab_0           conda-forge
    typing-extensions:       4.11.0-hd8ed1ab_0             conda-forge
    typing_extensions:       4.11.0-pyha770c72_0           conda-forge
    tzdata:                  2024a-h0c530f3_0              conda-forge
    ucrt:                    10.0.22621.0-h57928b3_0       conda-forge
    unicodecsv:              0.14.1-pyhd8ed1ab_2           conda-forge
    unicodedata2:            15.1.0-py310h8d17308_0        conda-forge
    urllib3:                 2.2.1-pyhd8ed1ab_0            conda-forge
    validate_email:          1.3-py_3                      conda-forge
    vc:                      14.3-hcf57466_18              conda-forge
    vc14_runtime:            14.38.33130-h82b7239_18       conda-forge
    vs2015_runtime:          14.38.33130-hcb4865c_18       conda-forge
    webdavclient3:           3.14.5-pyhd8ed1ab_1           conda-forge
    websocket-client:        1.8.0-pyhd8ed1ab_0            conda-forge
    werkzeug:                2.3.8-pyhd8ed1ab_0            conda-forge
    wheel:                   0.43.0-pyhd8ed1ab_1           conda-forge
    win_inet_pton:           1.1.0-pyhd8ed1ab_6            conda-forge
    wsproto:                 1.2.0-pyhd8ed1ab_0            conda-forge
    wtforms:                 3.1.2-pyhd8ed1ab_0            conda-forge
    xarray:                  2024.3.0-pyhd8ed1ab_0         conda-forge
    xmlschema:               2.5.1-pyhd8ed1ab_0            conda-forge
    xorg-libxau:             1.0.11-hcd874cb_0             conda-forge
    xorg-libxdmcp:           1.1.3-hcd874cb_0              conda-forge
    xstatic:                 1.0.2-pyh9f0ad1d_0            conda-forge
    xstatic-bootstrap:       4.5.3.1-pyhd3deb0d_0          conda-forge
    xstatic-jquery:          3.5.1.1-pyhd8ed1ab_5          conda-forge
    xz:                      5.2.6-h8d14728_0              conda-forge
    yaml:                    0.2.5-h8ffe710_2              conda-forge
    zipp:                    3.17.0-pyhd8ed1ab_0           conda-forge
    zlib:                    1.2.13-hcfcfb64_5             conda-forge
    zstd:                    1.5.6-h0ea2cb4_0              conda-forge

Additional Context

No response

ReimarBauer commented 4 months ago
Preparing transaction: ...working... done
Verifying transaction: ...working...
ClobberWarning: This transaction has incompatible packages due to a shared path.
  packages: conda-forge/win-64::git-2.45.0-h57928b3_1, conda-forge/win-64::git-2.45.0-h57928b3_1
  path: 'menu/menu-windows.json'

ClobberWarning: This transaction has incompatible packages due to a shared path.
  packages: local/win-64::mss-alpha-py310_1000, local/win-64::mss-alpha-py310_1000
  path: 'menu/mss_menu.json'

done
Executing transaction: ...working... done
set PREFIX=C:\Users\user\miniforge\conda-bld\mss_1714996915129\_test_env
set SRC_DIR=C:\Users\user\miniforge\conda-bld\mss_1714996915129\test_tmp

(base) %SRC_DIR%>call "%SRC_DIR%\conda_test_env_vars.bat"

(base) %SRC_DIR%>set "CONDA_SHLVL="   &&

(base) %SRC_DIR%>conda activate "%PREFIX%"
import: 'mslib'
import: 'mslib'
Fatal error in launcher: Unable to create process using '"C:\Users\user\miniforge\conda-bld\mss_1714996915129\_h_env\python.exe"  "C:\Users\user\miniforge\conda-bld\mss_1714996915129\_test_env\Scripts\mswms.exe" -h': Das System kann die angegebene Datei nicht finden.

WARNING: Tests failed for mss-alpha-py310_1000.tar.bz2 - moving package to C:\Users\user\miniforge\conda-bld\broken
TESTS FAILED: mss-alpha-py310_1000.tar.bz2
ReimarBauer commented 4 months ago

This is an example for this problem https://github.com/Open-MSS/MSS/tree/develop/localbuild

We need to use a https://github.com/Open-MSS/MSS/blob/develop/localbuild/bld.bat with %PYTHON% setup.py install --single-version-externally-managed --record record.txt and can't build by %PYTHON% -m pip install . --no-deps -vv

Let me know if I can improve our build or if you need further informations.