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

Python docs PyPI optional dependencies example broken #1850

Closed
2 tasks done
cdeil opened this issue Aug 20, 2024 · 2 comments · Fixed by #1856
Closed
2 tasks done

Python docs PyPI optional dependencies example broken #1850

cdeil opened this issue Aug 20, 2024 · 2 comments · Fixed by #1856
Labels
🐞 bug Something isn't working

Comments

@cdeil
Copy link
Contributor

cdeil commented Aug 20, 2024

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

On MacOS follow the tutorial at https://pixi.sh/dev/tutorials/python except use quotes since zsh requires this.

pixi add 'black[cli]' --pypi

Issue description

$ pixi add 'black[cli]' --pypi
 WARN The feature 'test' is defined but not used in any environment
✔ Added black[cli]
Added these as pypi-dependencies.

Expected behavior

As stated in the docs and printed on the console, the black[cli] should be listed as dependency including the [cli] part.

However it remains without that part:

dependencies = ["black"]
@cdeil cdeil added the 🐞 bug Something isn't working label Aug 20, 2024
@cdeil
Copy link
Contributor Author

cdeil commented Aug 20, 2024

This is not what I see when I follow the tutorial page:

Screenshot 2024-08-20 at 13 47 48

Also this is not what I see: https://pixi.sh/dev/tutorials/python/#installation-pixi-install

For me the default env was created much earlier and test is not an env but an unused feature.

At that point in the tutorial I get this:

(base) pix $ pixi install -e test
 WARN The feature 'test' is defined but not used in any environment
  × unknown environment 'test'

Did I make a mistake? Or did the way pixi work change and the docs need an update?

@cdeil
Copy link
Contributor Author

cdeil commented Aug 21, 2024

@ruben-arts - I see you are working on this in #1856 .

Trying do adopt pixi for one of our projects I ran into this error.

Just mentioning it here in this one since probably that's just another manifestation of brackets not working properly yet?

(base) hpred $ pixi init --import environment-py12.yml
  × invalid bracket

(base) hpred $ pixi --version
pixi 0.27.1

(base) hpred $ cat environment-py12.yml 
name: hpred12
channels:
  - nodefaults
  - conda-forge
dependencies:
  - python=3.12
  - pandas[performance]
  - scikit-learn
  - numpy

  - sqlalchemy
  - psycopg
  - pymssql

  # data files
  - pyarrow   # Parquet
  - openpyxl  # Excel

  # ML
  - ruptures
  - category_encoders
  - ppscore
  - dill
  - imbalanced-learn
  - scikit-lego

  # local dev
  - pre-commit # Also for CI
  - jupyterlab
  - alembic

  # viz
  - matplotlib
  - seaborn
  - bokeh
  - hiplot
  - shap
  - ipywidgets

  # Panel apps
  - panel
  - param
  - pyinstrument
  - tabulate
  - python-duckdb
  - duckdb-cli
  - click
  - nbconvert
  - missingno

  # testing
  - pytest
  - pytest-mock
  - pytest-cov
  - pytest-postgresql

  - pip
  - pip:
    # data
    - sqlalchemy-json

    # Azure
    - azure-core
    - azure-identity
    - azure-keyvault-secrets
    - azure-storage-blob
    - azure-kusto-data[pandas]  # ADX
    - opencensus-ext-azure  # Azure Application Insights

    # app
    - schedule
    - pytest-playwright

    # local DS
    - dvc[azure]

    # Panel
    - pyjwt
    - typing-extensions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant