Skip to content

Commit

Permalink
Move requirements-dev.txt dependencies to environment.yml (#812)
Browse files Browse the repository at this point in the history
* Move dev dependency specification to environment.yml
* Use `conda env update` instead of `conda install`
* Let setup miniconda auto activate pygmt conda environment
* Add section headers to environment.yml file

Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Will Schlitzer <schlitzer90@gmail.com>
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 17, 2021
1 parent 87cb403 commit 64702cd
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 32 deletions.
13 changes: 3 additions & 10 deletions .github/workflows/ci_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,15 @@ jobs:
- name: Setup Miniconda
uses: conda-incubator/setup-miniconda@v2.0.1
with:
activate-environment: pygmt
python-version: ${{ matrix.python-version }}
channels: conda-forge
miniconda-version: "latest"

# Install GMT and other required dependencies from conda-forge
- name: Install GMT and required dependencies
- name: Install dependencies
shell: bash -l {0}
run: |
requirements_file=full-conda-requirements.txt
cat requirements.txt requirements-dev.txt > $requirements_file
cat << EOF >> $requirements_file
gmt=6.1.1
make
codecov
EOF
conda install --yes --file $requirements_file
run: conda env update --file environment.yml

# Show installed pkg information for postmortem diagnostic
- name: List installed packages
Expand Down
2 changes: 1 addition & 1 deletion MAINTENANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ The main advantages of this are:

We use GitHub Actions continuous integration (CI) services to
build and test the project on Linux, macOS and Windows.
They rely on the `requirements.txt` file to install required dependencies using
They rely on the `environment.yml` file to install required dependencies using
conda and the `Makefile` to run the tests and checks.

### GitHub Actions
Expand Down
5 changes: 4 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@ channels:
- conda-forge
- defaults
dependencies:
- python=3.8
# Required dependencies
- pip
- gmt=6.1.1
- numpy
- pandas
- xarray
- netCDF4
- packaging
# Development dependencies
- black
- blackdoc
- codecov
- coverage[toml]
- docformatter
- flake8
- ipython
- isort>=5
- jupyter
- make
- matplotlib
- nbsphinx
- pylint
Expand Down
19 changes: 0 additions & 19 deletions requirements-dev.txt

This file was deleted.

2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Requirements for installing with conda
# Required packages
numpy
pandas
xarray
Expand Down

0 comments on commit 64702cd

Please sign in to comment.