mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-26 17:01:14 -06:00
2e7f3d1d0d
LGTM is no longer able to analyse all Python code without importing it. Define OS and Python package dependencies and build the project for Python, too. Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com>
37 lines
844 B
Python
Executable File
37 lines
844 B
Python
Executable File
#!/usr/bin/python3
|
|
"""Helper script to test LGTM config
|
|
|
|
$ contrib/lgtm_container.py > Dockerfile
|
|
$ docker build -t lgtm .
|
|
"""
|
|
import os
|
|
import yaml
|
|
|
|
LGTM_YML = os.path.join(os.path.dirname(__file__), '..', '.lgtm.yml')
|
|
|
|
|
|
def main():
|
|
with open(LGTM_YML) as f:
|
|
cfg = yaml.safe_load(f)
|
|
|
|
python = cfg['extraction']['python']
|
|
|
|
print("""\
|
|
FROM ubuntu:bionic
|
|
RUN apt-get update && \
|
|
apt-get install -y {dpkg} python3-venv && \
|
|
apt-get clean
|
|
RUN python3 -m venv /venv
|
|
RUN /venv/bin/pip install wheel
|
|
RUN /venv/bin/pip install {pypkg}
|
|
ADD . /freeipa
|
|
RUN cd /freeipa && ./autogen.sh --with-ipaplatform=debian
|
|
""".format(
|
|
dpkg=' '.join(python['prepare']['packages']),
|
|
pypkg=' '.join(python['python_setup']['requirements'])
|
|
))
|
|
|
|
|
|
if __name__ == '__main__':
|
|
main()
|