Skip to content

Commit

Permalink
Package management tools (#46)
Browse files Browse the repository at this point in the history
* remove setup.py, add __init__.py for directories that are actually python modules, edit requirements and dockerfile accordingly

* add pyproject.toml with poetry config, python version pin, and dependency pins

* generate requirements.txt from poetry, remove requirements.in

* add python version comments to dockerfile and pyproject.toml

* update readme with instructions and guidance for Poetry

* add poetry.lock file
  • Loading branch information
raaidarshad authored Jun 23, 2022
1 parent a772e0c commit 00a9ba6
Show file tree
Hide file tree
Showing 11 changed files with 769 additions and 81 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# if this python version changes, the python version in pyproject.toml needs to change too
FROM python:3.9
WORKDIR /app
COPY setup.py .
COPY lib/__init__.py lib/__init__.py
COPY requirements.txt /app
RUN pip install -r requirements.txt
COPY . .
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,21 @@ Environment parameters are defined in `env.json`.

You can add a new secret parameter [using AWS SSM](https://www.notion.so/Working-with-SSM-Parameters-82df52fd71b24762b541cc8439f40e4e).

## Development Tools

We use [Poetry](https://python-poetry.org/) to manage dependencies. It also helps with pinning dependency and python
versions.

### Setup

1. [Install Poetry](https://python-poetry.org/docs/#installation).
2. Run `poetry install --no-root`

### Update Dependencies

To update dependencies in your local environment, make changes to the `pyproject.toml` file then run `poetry update`.
To update `requirements.txt` for the container, run `poetry export -o requirements.txt --without-hashes`.

## Local Usage
1. Build the container
```
Expand Down
15 changes: 15 additions & 0 deletions cdk/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file added db/__init__.py
Empty file.
Empty file added handlers/__init__.py
Empty file.
Loading

0 comments on commit 00a9ba6

Please sign in to comment.