Skip to content

Commit

Permalink
Improve setup.py for installation (#20)
Browse files Browse the repository at this point in the history
Signed-off-by: changwangss <[email protected]>
  • Loading branch information
changwangss authored May 30, 2024
1 parent f5ea57c commit 48d7989
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker/code-scan.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \

RUN ln -sf $(which python3) /usr/bin/python

RUN pip install --upgrade pip setuptools==69.5.1
RUN python -m pip install --no-cache-dir bandit==1.7.8
RUN wget -O /bin/hadolint https://github.com/hadolint/hadolint/releases/download/v2.12.0/hadolint-Linux-x86_64
RUN chmod +x /bin/hadolint
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docker/common.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
vim \
wget

RUN pip install --upgrade pip setuptools==69.5.1
RUN ln -sf $(which python3) /usr/bin/python
RUN python -m pip install --no-cache-dir pytest

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docker/hpu.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ COPY ${REPO_PATH} /genaieval
RUN if [ "$REPO_PATH" == "" ]; then rm -rf /genaieval/* && rm -rf /genaieval/.* ; git clone --single-branch --branch=${BRANCH} ${REPO} /genaieval ; fi

# Build From Source
RUN pip install --upgrade pip setuptools==69.5.1
RUN cd /genaieval && \
pip install -r requirements.txt && \
python setup.py install && \
pip install --upgrade-strategy eager optimum[habana] && \
pip list
Expand Down
2 changes: 2 additions & 0 deletions Docker/hpu.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ SHELL ["/bin/bash", "--login", "-c"]
RUN mkdir -p /GenAIEval
COPY ${REPO_PATH} /GenAIEval
RUN if [ "$REPO_PATH" == "" ]; then rm -rf /GenAIEval/* && rm -rf /GenAIEval/.* ; git clone --single-branch --branch=${BRANCH} ${REPO} /GenAIEval ; fi
RUN pip install --upgrade pip setuptools==69.5.1

# Build From Source
RUN cd /GenAIEval && \
pip install -r requirements.txt && \
python setup.py install && \
pip install --upgrade-strategy eager optimum[habana] && \
pip list
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
git+https://github.com/bigcode-project/bigcode-evaluation-harness.git@a1b4a7949a24c8e3ef0d05a01097b2d14ffba56e
bigcode-eval@git+https://github.com/bigcode-project/bigcode-evaluation-harness.git@a1b4a7949a24c8e3ef0d05a01097b2d14ffba56e
lm-eval==0.4.2

8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,11 @@

from setuptools import find_packages, setup

result = subprocess.Popen("pip install -r requirements.txt", shell=True)
result.wait()

def parse_requirements(filename):
with open(filename, "r") as file:
return [line.strip() for line in file if line.strip() and not line.startswith("#")]


setup(
name="GenAIEval",
Expand All @@ -32,5 +35,6 @@
long_description_content_type="text/markdown",
url="https://github.com/opea-project/GenAIEval",
packages=find_packages(),
install_requires=parse_requirements("requirements.txt"),
python_requires=">=3.10",
)

0 comments on commit 48d7989

Please sign in to comment.