Skip to content

Commit acc6e36

Browse files
committed
Merge branch 'remove-poetry' into rework-regression-model
2 parents ddd5fe9 + fc4546f commit acc6e36

9 files changed

+58
-4456
lines changed

Dockerfile

+10-20
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2323
build-essential \
2424
&& rm -rf /var/lib/apt/lists/*
2525

26+
WORKDIR /reward_preprocessing
27+
2628
ENV PATH="/venv/bin:$PATH"
29+
COPY ./requirements.txt /reward_preprocessing/
30+
COPY ./requirements-dev.txt /reward_preprocessing/
2731
COPY ci/build_and_activate_venv.sh ./ci/build_and_activate_venv.sh
2832
RUN ci/build_and_activate_venv.sh /venv
2933

30-
RUN curl -sSL https://install.python-poetry.org | python -
31-
ENV PATH="/root/.local/bin:$PATH"
32-
33-
34-
WORKDIR /reward_preprocessing
35-
# Copy only necessary dependencies to build virtual environment.
36-
# This minimizes how often this layer needs to be rebuilt.
37-
COPY poetry.lock pyproject.toml ./
38-
# Ideally, we'd clear the poetry cache but this seems annoyingly
39-
# difficult and not worth getting right for this project
40-
# (I've tried some things from https://github.com/python-poetry/poetry/issues/521
41-
# without success)
42-
RUN poetry install --no-interaction --no-ansi
43-
44-
# clear the directory again (this is necessary so that CircleCI can checkout
45-
# into the directory)
46-
RUN rm poetry.lock pyproject.toml
4734

4835
# full stage contains everything.
4936
# Can be used for deployment and local testing.
@@ -55,7 +42,10 @@ COPY . /reward_preprocessing
5542
# Note that all dependencies were already installed in the previous stage.
5643
# The purpose of this is only to make the local code available as a package for
5744
# easier import.
58-
RUN poetry run python setup.py sdist bdist_wheel
59-
RUN poetry run pip install dist/reward_preprocessing-*.whl
45+
RUN python setup.py sdist bdist_wheel
46+
RUN pip install dist/reward_preprocessing-*.whl
47+
48+
# Move into src directory, so scripts can be run from outside the docker container.
49+
CMD cd src/
6050

61-
CMD ["poetry", "run", "pytest"]
51+
CMD ["pytest"]

README.md

+5-8
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33

44
## Installation
55
First clone this repository.
6-
We use [`poetry`](https://python-poetry.org/) to manage dependencies.
7-
You can reproduce our environment with
8-
```
9-
poetry install
10-
pip install git+https://github.com/HumanCompatibleAI/imitation
6+
Install inside your python virtual environment system of choice:
7+
8+
```bash
9+
pip install -r requirements.txt
10+
pip install -r requirements-dev.txt # If dev packages are needed.
1111
```
12-
(run this command inside the cloned repo). This will automatically create a new
13-
virtual environment.
14-
Use `poetry shell` to start a shell inside this virtual environment.
1512

1613
Note on the python version: if you use a separate installation of `imitation`
1714
for creating reward models, then make sure that your environment for `imitation`

ci/build_and_activate_venv.sh

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ fi
1010
virtualenv -p python3.9.5 ${venv}
1111
source ${venv}/bin/activate
1212

13+
pip install -r requirements.txt
14+
pip install -r requirements-dev.txt
15+
1316
if [[ $USE_MPI == "True" ]]; then
1417
pip install mpi4py
1518
fi

ci/code_checks.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ SRC_FILES=(src/ tests/ setup.py)
66
set -x # echo commands
77
set -e # quit immediately on error
88

9-
poetry run flake8 ${SRC_FILES[@]}
10-
poetry run black --check ${SRC_FILES[@]}
9+
flake8 ${SRC_FILES[@]}
10+
black --check ${SRC_FILES[@]}

0 commit comments

Comments
 (0)