File: convert_deps.py

package info (click to toggle)
pandas 0.23.3%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 167,704 kB
  • sloc: python: 230,826; ansic: 11,317; sh: 682; makefile: 133
file content (29 lines) | stat: -rwxr-xr-x 902 bytes parent folder | download
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
"""
Convert the conda environment.yaml to a pip requirements.txt
"""
import yaml

exclude = {'python=3'}
rename = {'pytables': 'tables'}

with open("ci/environment-dev.yaml") as f:
    dev = yaml.load(f)

with open("ci/requirements-optional-conda.txt") as f:
    optional = [x.strip() for x in f.readlines()]

required = dev['dependencies']
required = [rename.get(dep, dep) for dep in required if dep not in exclude]
optional = [rename.get(dep, dep) for dep in optional if dep not in exclude]


with open("ci/requirements_dev.txt", 'wt') as f:
    f.write("# This file was autogenerated by scripts/convert_deps.py\n")
    f.write("# Do not modify directly\n")
    f.write('\n'.join(required))


with open("ci/requirements-optional-pip.txt", 'wt') as f:
    f.write("# This file was autogenerated by scripts/convert_deps.py\n")
    f.write("# Do not modify directly\n")
    f.write("\n".join(optional))