ansys / pyprimemesh

Pythonic Meshing Client for Ansys Prime Server
https://prime.docs.pyansys.com/
MIT License
19 stars 9 forks source link

Bug: ansys-meshing-prime versions > 0.3.0.dev0 are not available when using the Ansys Private Pypi as main index. #760

Closed anscfrisson closed 4 months ago

anscfrisson commented 4 months ago

πŸ” Before submitting the issue

🐞 Description of the bug

From: https://dev.docs.pyansys.com/how-to/releasing.html#artifact-download

Warning

Take care to always use the --index-url switch rather than the --extra-index-url switch. As noted in pip Documentation, the --index-url switch changes the Python Package Index, which forces pip to use only packages from that package index.

The Ansys package index uses PyPI upstream. This prevents other users from being able to inject packages from PyPI that would supersede Ansys packages, even if they are of a higher version.

This is not the case if you use --extra-index-url, which adds to rather than replaces the default package index. For security, do not use --extra-index-url.

If I define environment variables in github actions:

Are ansys-meshing-prime versions > 0.3.0.dev0 not relayed by the Ansys Private Pypi?

πŸ“ Steps to reproduce

Request the value of the PYANSYS_PYPI_PRIVATE_READ_PAT token by sending an email to the pyansys.core@ansys.com email.

Works

export PIP_INDEX_URL=
export PIP_EXTRA_INDEX_URL="https://$PYANSYS_PYPI_PRIVATE_READ_PAT@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple"
pip install ansys-meshing-prime==v0.6.0.dev7
Looking in indexes: https://pypi.org/simple, https://****@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple
Collecting ansys-meshing-prime==v0.6.0.dev7
  Downloading ansys_meshing_prime-0.6.0.dev7-py3-none-any.whl (398 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 398.2/398.2 kB 3.6 MB/s eta 0:00:00
...

Fails

export PIP_INDEX_URL="https://$PYANSYS_PYPI_PRIVATE_READ_PAT@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple"
export PIP_EXTRA_INDEX_URL=
pip install ansys-meshing-prime=v0.6.0.dev7
Looking in indexes: https://****@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple
ERROR: Could not find a version that satisfies the requirement ansys-meshing-prime==v0.6.0.dev7 (from versions: 0.2.0.dev0, 0.2.0.dev17, 0.2.0.dev18, 0.2.0, 0.3.0.dev0)
ERROR: No matching distribution found for ansys-meshing-prime==v0.6.0.dev7

πŸ’» Which operating system are you using?

Windows

πŸ“€ Which ANSYS version are you using?

242

🐍 Which Python version are you using?

3.10

πŸ“¦ Installed packages

(none: tested from new virtual environment)
rchopade7 commented 4 months ago

@anscfrisson 0.6.0.dev client packages are not published to pyansys/pypi, that is why you are not able to install latest pyprimemesh dev client when you set PIP_INDEX_URL to pyansys/pypi.

cc @prajaktmahajan @waltersma

RobPasMue commented 4 months ago

@anscfrisson - this is related to the Private PyPI configuration. Could you give it a try again?

RobPasMue commented 4 months ago

I just did some modifications to enable ansys-meshing-prime and ansys-api-meshing-prime upstream versions (i.e. from public PyPI)

anscfrisson commented 4 months ago

@RobPasMue Thanks for the updates! I can confirm via CI checks in a private repository that the ansys private pypi works as pip index (using environment variable PIP_INDEX_URL instead of PIP_EXTRA_INDEX_URL) to relay pyprimemesh packages. Closing issue.