Skip to content

Commit 64702cd

Browse files
seismanwillschlitzerweiji14
authored
Move requirements-dev.txt dependencies to environment.yml (#812)
* 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 <[email protected]> Co-authored-by: Will Schlitzer <[email protected]> Co-authored-by: Wei Ji <[email protected]>
1 parent 87cb403 commit 64702cd

File tree

5 files changed

+9
-32
lines changed

5 files changed

+9
-32
lines changed

.github/workflows/ci_tests.yaml

+3-10
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,15 @@ jobs:
6969
- name: Setup Miniconda
7070
uses: conda-incubator/[email protected]
7171
with:
72+
activate-environment: pygmt
7273
python-version: ${{ matrix.python-version }}
7374
channels: conda-forge
7475
miniconda-version: "latest"
7576

7677
# Install GMT and other required dependencies from conda-forge
77-
- name: Install GMT and required dependencies
78+
- name: Install dependencies
7879
shell: bash -l {0}
79-
run: |
80-
requirements_file=full-conda-requirements.txt
81-
cat requirements.txt requirements-dev.txt > $requirements_file
82-
cat << EOF >> $requirements_file
83-
gmt=6.1.1
84-
make
85-
codecov
86-
EOF
87-
conda install --yes --file $requirements_file
80+
run: conda env update --file environment.yml
8881

8982
# Show installed pkg information for postmortem diagnostic
9083
- name: List installed packages

MAINTENANCE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The main advantages of this are:
4242

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

4848
### GitHub Actions

environment.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,25 @@ channels:
33
- conda-forge
44
- defaults
55
dependencies:
6-
- python=3.8
6+
# Required dependencies
77
- pip
88
- gmt=6.1.1
99
- numpy
1010
- pandas
1111
- xarray
1212
- netCDF4
1313
- packaging
14+
# Development dependencies
1415
- black
1516
- blackdoc
17+
- codecov
1618
- coverage[toml]
1719
- docformatter
1820
- flake8
1921
- ipython
2022
- isort>=5
2123
- jupyter
24+
- make
2225
- matplotlib
2326
- nbsphinx
2427
- pylint

requirements-dev.txt

-19
This file was deleted.

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Requirements for installing with conda
1+
# Required packages
22
numpy
33
pandas
44
xarray

0 commit comments

Comments
 (0)