-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
59 lines (59 loc) · 2.41 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: pydeps2env
description: create conda environment file from python project dependencies
branding:
icon: code
color: yellow
inputs:
files:
description: >-
Specify the location of the dependencies files to parse. (defaults to 'pyproject.toml')
Separate a list of multiple source files by spaces (e.g. 'pyproject.toml[test] requirements.txt').
required: true
default: pyproject.toml
output:
description: >-
Specify the location and name of the conda environment file to generate. (defaults to 'environment.yml')
required: true
default: environment.yml
channels:
description: >-
List the conda channels to include in the environment file. (defaults to 'conda-forge')
Separate a list of multiple channels by spaces (e.g. 'conda-forge defaults').
required: true
default: conda-forge
extras:
description: >-
Specify one or more optional [extras_require] sections to add to all source files (s.a.).
(e.g. 'test' to include package that you would normally install with 'pip install pkg[test]').
Note that for individual sources in 'files', the '[extra]' syntax is also possible.
required: false
build_system:
description: >-
if set to 'include' the dependencies listed under [build-system] (for 'pyproject.toml') or [options]:setup_requires (for 'setup.cfg') will be added to the environment
(default is 'omit' so no build system dependencies will be installed)
required: false
default: omit
pip:
description: >-
List of packages to install via pip instead of conda.
The dependencies will be listet under the pip section in the environment file.
If a dependency is listed with its URN, it will always be installed via pip (e.g. 'pydeps2env @ git+https://github.com/CagtayFabry/pydeps2env')
required: false
runs:
using: composite
steps:
- name: create environment file
run: >
pip3 install tomli packaging pyyaml $PIP_OPTIONS &&
python3 $GITHUB_ACTION_PATH/pydeps2env/generate_environment.py ${{ inputs.files }}
--output ${{ inputs.output }}
--channels ${{ inputs.channels }}
--extras ${{ inputs.extras }}
--build_system ${{ inputs.build_system }}
--pip ${{ inputs.pip }}
shell: bash
env:
PIP_OPTIONS: ${{ runner.os == 'macOS' && '--break-system-packages' || '' }}
- name: show environment file
run: cat ${{ inputs.output }}
shell: bash