Skip to content

Commit

Permalink
Change poetry to pipenv
Browse files Browse the repository at this point in the history
  • Loading branch information
rdettai committed May 15, 2024
1 parent 59e78e2 commit 293153f
Show file tree
Hide file tree
Showing 7 changed files with 419 additions and 1,112 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/publish_lambda_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ jobs:
- name: Install rustup
run: curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain none -y
- name: Install python dependencies
run: pip install ./distribution/lambda
- name: Mypy lint
run: mypy distribution/lambda/
run: |
pip install --user pipenv
pipenv install --system
working-directory: ./distribution/lambda
- name: Lint and format
run: |
mypy .
black . --check
working-directory: ./distribution/lambda
- name: Retrieve and export commit date, hash, and tags
run: |
echo "QW_COMMIT_DATE=$(TZ=UTC0 git log -1 --format=%cd --date=format-local:%Y-%m-%dT%H:%M:%SZ)" >> $GITHUB_ENV
Expand Down
1 change: 1 addition & 0 deletions distribution/lambda/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ package:
if [ "$${QW_LAMBDA_BUILD:-0}" = "1" ]
then
pushd ../../quickwit/
rustc --version
cargo lambda build \
-p quickwit-lambda \
--release \
Expand Down
23 changes: 23 additions & 0 deletions distribution/lambda/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
aws-cdk-lib = "2.95.1"
cargo-lambda = "1.1.0"
constructs = "10.3.0"
pyyaml = "6.0.1"
black = "24.3.0"
boto3 = "1.28.59"
mypy = "1.7.0"
ziglang = "0.11.0"

# boto3-stubs = "^1.28.39"
# types-requests = "^2.31.0.2"
# types-pyyaml = "^6.0.12.11"

[dev-packages]

[requires]
python_version = ">=3.10,<4.0"
381 changes: 381 additions & 0 deletions distribution/lambda/Pipfile.lock

Large diffs are not rendered by default.

33 changes: 5 additions & 28 deletions distribution/lambda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,36 +31,13 @@ console](https://console.aws.amazon.com/servicequotas/home/services/lambda/quota
### Python venv

This project is set up like a standard Python project. The initialization
process also creates a virtualenv within this project, stored under the `.venv`
directory. To create the virtualenv it assumes that there is a `python3`
executable in your path with access to the `venv` package. If for any reason the
automatic creation of the virtualenv fails, you can create the virtualenv
manually.
The Python environment is configured using pipenv:

To manually create a virtualenv on MacOS and Linux:

```bash
python3 -m venv .venv
```

After the init process completes and the virtualenv is created, you can use the following
step to activate your virtualenv.

```bash
source .venv/bin/activate
```

Once the virtualenv is activated, you can install the required dependencies.

```bash
pip install .
```

If you prefer using Poetry, achieve the same by running:
```bash
poetry shell
poetry install
# Install pipenv if needed.
pip install --user pipenv
pipenv shell
pipenv install
```

### Example stacks
Expand Down
1,054 changes: 0 additions & 1,054 deletions distribution/lambda/poetry.lock

This file was deleted.

27 changes: 0 additions & 27 deletions distribution/lambda/pyproject.toml

This file was deleted.

0 comments on commit 293153f

Please sign in to comment.