Skip to content

Commit

Permalink
readme: revise conda instructions
Browse files Browse the repository at this point in the history
This partially reverts 5fb49a5.

Reason: Adding the channels permanently has the advantage of including
pypdfium2 in updates by default. It is also good to tighten channel prio
to be on the safe side.
  • Loading branch information
mara004 committed Nov 15, 2023
1 parent 45e8f0c commit 07d336e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/2_conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ body:
python -m pip show pypdfium2_raw
python -m pip show pypdfium2_helpers
conda list --show-channel-urls "pypdfium2|pdfium-binaries"
conda config --get
conda info
conda config --show-sources
```
validations:
required: true
Expand Down
24 changes: 19 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,37 @@ pypdfium2 includes helpers to simplify common use cases, while the raw PDFium/ct

* <a id="user-content-install-conda" class="anchor" href="#install-conda">From Conda 🔗</a> (official)
```bash
conda install pypdfium2_helpers -c bblanchon -c pypdfium2-team
conda config --add channels bblanchon
conda config --add channels pypdfium2-team
conda config --set channel_priority strict
conda install pypdfium2-team::pypdfium2_helpers
```
Adding the channels permanently and tightening priority is optional, but encouraged to include pypdfium2 in `conda update` by default, and to avoid accidentally replacing the install with a different channel.
If desired, you may limit the channel config to the current environment by adding `--env`.

Alternatively, it is possible to allow the channels only once on install, but then you should be cautious when making changes to the environment:
```bash
conda install pypdfium2-team::pypdfium2_helpers -c bblanchon -c pypdfium2-team
```
**Beware:** There have been some third-party attempts to conda package pypdfium2 and pdfium-binaries. Any recipes/packages that might be provided by other distributors, including `anaconda` or `conda-forge` default channels, are [unofficial](#install-unofficial).

To depend on pypdfium2 in a recipe:
```yaml
requirements:
run:
- pypdfium2-team::pypdfium2_helpers
```
You'll want to have downstream callers allow the custom channels on install as shown above, otherwise conda may not be able to satisfy the dependencies.
You'll want to have downstream callers handle the custom channels as shown above, otherwise conda will not be able to satisfy requirements.
**Beware:** There have been some third-party attempts to conda package pypdfium2 and pdfium-binaries. Any recipes/packages that might be provided by other distributors, including `anaconda` or `conda-forge` default channels, are [unofficial](#install-unofficial).
To check if the sources are correct:
To check the sources are correct:
```bash
conda list --show-channel-urls "pypdfium2|pdfium-binaries"
conda config --show-sources
```
It should show `pypdfium2-team` and `bblanchon` in the channels column.
The table should show `pypdfium2-team` and `bblanchon` in the channels column.
If added permanently, the config should also include these channels, ideally with top priority.
Please confirm this before reporting any issue with a conda install of pypdfium2.
* <a id="user-content-install-unofficial" class="anchor" href="#install-unofficial">Unofficial packages 🔗</a>
Expand Down

0 comments on commit 07d336e

Please sign in to comment.