mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-22 14:24:03 -07:00
adding dockerfile and test for yourbase
This commit is contained in:
parent
5db47867de
commit
4f658454d7
3 changed files with 55 additions and 4 deletions
41
Dockerfile
Normal file
41
Dockerfile
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
# Start from the yb_ubuntu:18.04 base image
|
||||||
|
FROM yourbase/yb_ubuntu:18.04
|
||||||
|
|
||||||
|
|
||||||
|
# Update the package manager and install Python 3.9
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y python3.10 && \
|
||||||
|
apt-get install -y git
|
||||||
|
|
||||||
|
RUN which python3
|
||||||
|
|
||||||
|
# Set the default Python version to 3.10
|
||||||
|
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
|
||||||
|
|
||||||
|
|
||||||
|
# Download the get-pip.py script and install pip
|
||||||
|
RUN curl https://bootstrap.pypa.io/pip/3.6/get-pip.py -o get-pip.py
|
||||||
|
RUN python3 get-pip.py
|
||||||
|
|
||||||
|
# Verify that pip is installed
|
||||||
|
RUN pip --version
|
||||||
|
|
||||||
|
RUN pip install yourbase
|
||||||
|
|
||||||
|
RUN pip install nose
|
||||||
|
|
||||||
|
RUN pip install pytest
|
||||||
|
|
||||||
|
ENV YTDL_TEST_SET core
|
||||||
|
|
||||||
|
# Copy the repository into the container
|
||||||
|
COPY . /app
|
||||||
|
|
||||||
|
# Set the working directory to the app directory
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Install any dependencies required by the repository using pip
|
||||||
|
# RUN python3 -m pip install -r requirements.txt
|
||||||
|
|
||||||
|
# Run any necessary setup commands for the repository
|
||||||
|
CMD ["./devscripts/test-yourbase.sh"]
|
11
devscripts/test-yourbase.sh
Executable file
11
devscripts/test-yourbase.sh
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Only run in docker container
|
||||||
|
# Run initial test with nosetest and yourbase
|
||||||
|
/app/devscripts/run_tests.sh
|
||||||
|
|
||||||
|
# Edit some files
|
||||||
|
echo "print('Hello World')" >> youtube_dl/extractor/buzzfeed.py
|
||||||
|
|
||||||
|
# Run test again
|
||||||
|
/app/devscripts/run_tests.sh
|
|
@ -7,8 +7,7 @@ import platform
|
||||||
print("davi logs", sys.version[0:3])
|
print("davi logs", sys.version[0:3])
|
||||||
print("davi logs", platform.python_implementation())
|
print("davi logs", platform.python_implementation())
|
||||||
|
|
||||||
if sys.version[0:3] == '3.9':
|
import unittest
|
||||||
import unittest
|
import yourbase
|
||||||
import yourbase
|
|
||||||
|
|
||||||
yourbase.attach(unittest)
|
yourbase.attach(unittest)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue