Skip to content

Commit

Permalink
Use Dependente to capture dependencies on CI (#289)
Browse files Browse the repository at this point in the history
Dependente (https://github.com/fatiando/dependente) does what the code
in our `tools` folder did. Use it instead. Add the extra dependencies to
setup.cfg as install targets for pip so that they can be extracted by
dependente.
  • Loading branch information
leouieda authored Jan 10, 2022
1 parent 4591852 commit 52240b9
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 72 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,20 +63,21 @@ jobs:
with:
python-version: ${{ env.PYTHON }}

- name: Collect requirements - run-time
run: python tools/export_requirements.py > requirements-full.txt

- name: Collect requirements - other
- name: Collect requirements
run: |
echo "Install Dependente to capture dependencies:"
python -m pip install dependente==0.2.0
echo ""
echo "Capturing run-time dependencies:"
dependente --source install,extras > requirements-full.txt
echo ""
echo "Capturing dependencies from:"
for requirement in $REQUIREMENTS
do
echo " $requirement"
cat $requirement >> requirements-full.txt
done
- name: List requirements
run: |
echo ""
echo "Collected dependencies:"
cat requirements-full.txt
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,28 +88,28 @@ jobs:
with:
python-version: ${{ matrix.python }}

- name: Collect requirements - run-time
run: python tools/export_requirements.py > requirements-full.txt

- name: Collect requirements - optional
if: matrix.dependencies == 'optional' || matrix.dependencies == 'oldest'
run: cat env/requirements-optional.txt >> requirements-full.txt

- name: Collect requirements - convert to oldest supported
if: matrix.dependencies == 'oldest'
run: python tools/oldest_requirements.py requirements-full.txt

- name: Collect requirements - other
- name: Collect requirements
run: |
echo "Install Dependente to capture dependencies:"
python -m pip install dependente==0.2.0
echo ""
dependente_args="--source install"
if [[ "${{ matrix.dependencies }}" == "oldest" ]]; then
dependente_args="--oldest --source install,extras"
fi
if [[ "${{ matrix.dependencies }}" == "optional" ]]; then
dependente_args="--source install,extras"
fi
echo "Capturing run-time dependencies:"
dependente $dependente_args > requirements-full.txt
echo ""
echo "Capturing dependencies from:"
for requirement in $REQUIREMENTS
do
echo " $requirement"
cat $requirement >> requirements-full.txt
done
- name: List requirements
run: |
echo ""
echo "Collected dependencies:"
cat requirements-full.txt
Expand Down
4 changes: 0 additions & 4 deletions env/requirements-optional.txt

This file was deleted.

8 changes: 8 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ install_requires =
packaging>=20.0
requests>=2.19.0

[options.extras_require]
progress =
tqdm>=4.41.0,<5.0.0
sftp =
paramiko>=2.7.0
xxhash =
xxhash>=1.4.3

[options.package_data]
pooch.tests = data/*, data/store/*, data/store/subdir/*

Expand Down
19 changes: 0 additions & 19 deletions tools/export_requirements.py

This file was deleted.

27 changes: 0 additions & 27 deletions tools/oldest_requirements.py

This file was deleted.

0 comments on commit 52240b9

Please sign in to comment.