Skip to content

Commit

Permalink
Use 'python -m pip install' instead of 'pip install' (#2490)
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman authored Apr 11, 2023
1 parent da07fb3 commit 8cacfc4
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cache_data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install the package
run: |
python -m build --sdist
pip install dist/*
python -m pip install dist/*
# Download remote files
- name: Download remote data
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
- name: Install the package
run: |
python -m build --sdist
pip install dist/*
python -m pip install dist/*
# Build the documentation
- name: Build the documentation
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_tests_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
mamba install python=${{ matrix.python-version }} \
ninja cmake libblas libcblas liblapack fftw libgdal \
geopandas ghostscript libnetcdf hdf5 zlib curl pcre make
pip install --pre --prefer-binary \
python -m pip install --pre --prefer-binary \
numpy pandas xarray netCDF4 packaging \
build contextily dvc ipython rioxarray \
'pytest>=6.0' pytest-cov pytest-doctestplus pytest-mpl \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/format-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
# Install formatting tools
- name: Install formatting tools
run: |
pip install black blackdoc docformatter==1.5.1 flakeheaven isort
python -m pip install black blackdoc docformatter==1.5.1 flakeheaven isort
sudo apt-get install dos2unix
# Run "make format" and commit the change to the PR branch
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/style_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: Install packages
run: |
pip install black blackdoc docformatter==1.5.1 flakeheaven pylint isort
python -m pip install black blackdoc docformatter==1.5.1 flakeheaven pylint isort
sudo apt-get install dos2unix
- name: Formatting check (black, blackdoc, docformatter, flakeheaven and isort)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ help:
@echo ""

install:
pip install --no-deps -e .
python -m pip install --no-deps -e .

package:
python -m build
Expand Down
2 changes: 1 addition & 1 deletion doc/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ To install the current source code into your testing environment, run:

```bash
make install # on Linux/macOS
pip install --no-deps -e . # on Windows
python -m pip install --no-deps -e . # on Windows
```

This installs your project in *editable* mode, meaning that changes made to the source
Expand Down
6 changes: 3 additions & 3 deletions doc/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -218,17 +218,17 @@ Using pip
This installs the latest stable release from
`PyPI <https://pypi.org/project/pygmt>`__::

pip install pygmt
python -m pip install pygmt

.. tip::

You can also run ``pip install pygmt[all]`` to install pygmt with
You can also run ``python -m pip install pygmt[all]`` to install pygmt with
all of its optional dependencies.

Alternatively, you can install the latest development version from
`TestPyPI <https://test.pypi.org/project/pygmt>`__::

pip install --pre --extra-index-url https://test.pypi.org/simple/ pygmt
python -m pip install --pre --extra-index-url https://test.pypi.org/simple/ pygmt

To upgrade the installed stable release or development version to be the latest
one, just add ``--upgrade`` to the corresponding command above.
Expand Down
4 changes: 2 additions & 2 deletions pygmt/datasets/tile_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def load_tile_map(region, zoom="auto", source=None, lonlat=True, wait=0, max_ret
ImportError
If ``contextily`` is not installed or can't be imported. Follow
:doc:`install instructions for contextily <contextily:index>`, (e.g.
via ``pip install contextily``) before using this function.
via ``python -m pip install contextily``) before using this function.
Examples
--------
Expand All @@ -111,7 +111,7 @@ def load_tile_map(region, zoom="auto", source=None, lonlat=True, wait=0, max_ret
if contextily is None:
raise ImportError(
"Package `contextily` is required to be installed to use this function. "
"Please use `pip install contextily` or "
"Please use `python -m pip install contextily` or "
"`mamba install -c conda-forge contextily` "
"to install the package."
)
Expand Down
5 changes: 3 additions & 2 deletions pygmt/src/tilemap.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,14 +115,15 @@ def tilemap(
ImportError
If ``rioxarray`` is not installed. Follow
:doc:`install instructions for rioxarray <rioxarray:installation>`,
(e.g. via ``pip install rioxarray``) before using this function.
(e.g. via ``python -m pip install rioxarray``) before using this
function.
"""
kwargs = self._preprocess(**kwargs) # pylint: disable=protected-access

if rioxarray is None:
raise ImportError(
"Package `rioxarray` is required to be installed to use this function. "
"Please use `pip install rioxarray` or "
"Please use `python -m pip install rioxarray` or "
"`mamba install -c conda-forge rioxarray` "
"to install the package."
)
Expand Down

0 comments on commit 8cacfc4

Please sign in to comment.