Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Switch to poetry and publish pypi package #44

Merged
merged 16 commits into from
Sep 4, 2020
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@

## Development setup

Install dependencies with
Install the correct version of poetry:

```
pipenv install
pip3 install poetry==poetry==1.0.10
brendongo marked this conversation as resolved.
Show resolved Hide resolved
```

Install dependencies with poetry

```
poetry install
```

Run the agent with

```
pipenv shell
poetry shell
export PYTHONPATH=$(pwd)/src
python -m semgrep_agent --config p/r2c
```
Expand All @@ -29,3 +35,9 @@ Connect to semgrep-app with the `--publish-deployment` & `--publish-token` flags
Let CI pass on GitHub Actions before releasing.
The following command will change all action runs to use your current `HEAD`:
```make release```

### Publishing to pypi

```
poetry publish
```
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
FROM returntocorp/semgrep:0.22.0@sha256:f9c9f9712557599b54658d0ccde32b70f36c26caaf5c64591eabad857b205caa AS semgrep
FROM python:3.8-alpine
FROM python:3.7-alpine

WORKDIR /app
COPY Pipfile* ./
COPY poetry.lock ./
COPY pyproject.toml ./

ENV INSTALLED_SEMGREP_VERSION=0.22.0

COPY --from=semgrep /usr/local/bin/semgrep-core /tmp/semgrep-core

RUN apk add --no-cache --virtual=.build-deps build-base libffi-dev openssl-dev &&\
apk add --no-cache --virtual=.run-deps bash git less libffi openssl &&\
pip install --no-cache-dir pipenv==2020.5.28 &&\
pipenv install --system &&\
pip install --no-cache-dir poetry==1.0.10 &&\
pip install --no-cache-dir pipx &&\
PRECOMPILED_LOCATION=/tmp/semgrep-core pipx install semgrep==${INSTALLED_SEMGREP_VERSION} &&\
pip uninstall -y pipenv &&\
poetry config virtualenvs.create false &&\
# Don't install dev dependencies or semgrep-agent
poetry install --no-dev --no-root &&\
pip uninstall -y poetry &&\
apk del .build-deps &&\
rm -rf /root/.cache/* /tmp/*

Expand Down
22 changes: 0 additions & 22 deletions Pipfile

This file was deleted.

166 changes: 0 additions & 166 deletions Pipfile.lock

This file was deleted.

Loading