Skip to content

Commit

Permalink
feat: convert to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
vjeeva committed Jul 13, 2022
1 parent c27cb09 commit 07f9a10
Show file tree
Hide file tree
Showing 8 changed files with 512 additions and 44 deletions.
11 changes: 3 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PYTHON_CODE_PATH="./dbupgrade"
PYTHON_CODE_PATH="./pgbelt"

.DEFAULT_GOAL := help

Expand All @@ -8,17 +8,12 @@ help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-40s\033[0m %s\n", $$1, $$2}'

install: ## Install whatever you have locally
pip install -e .
poetry install --no-dev

setup: ## Install development requirements. You should be in a virtualenv
pip install -r requirements.txt && pip install -r requirements-test.txt && pre-commit install
poetry install && pre-commit install

test: ## Run tests
pytest

tests: test

usage-doc:
pip install -r requirements-docs.txt && typer pgbelt.main utils docs --name belt --output docs/usage.md

docs: usage-doc setup ## Rebuild any docs that can be autogenerated.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,26 @@ See the Checking Source DB Prerequisites section below.

## Installation
### Install From A Clone
If you can't use brew but are proficient with python and virtual environments
you can install pgbelt as an egg from a local clone of this repo. These instructions
You can install pgbelt as an egg from a local clone of this repo. These instructions
assume you are using [pyenv](https://github.com/pyenv/pyenv) and the
[pyenv-virtualenv](https://github.com/pyenv/pyenv-virtualenv) plugin to manage
python versions and virtual environments.
python versions and virtual environments. This tool also uses [poetry](https://github.com/python-poetry/poetry),
so you must have that installed as well.

If you use this installation method you will have to manually install postgres
client tools like pg_dump and pg_restore that belt depends on.

# create a python virtualenv with python 3.9.6 and activate it (any 3.9.x is ok)
pyenv install 3.9.6
pyenv virtualenv 3.9.6 pgbelt
# create a python virtualenv with python 3.9.11 and activate it (any 3.9.x is ok)
pyenv install 3.9.11
pyenv virtualenv 3.9.11 pgbelt
pyenv activate pgbelt

# clone the repo
git clone git@github.com:Autodesk/pgbelt.git
cd pgbelt

# install pgbelt in your virtualenv
make install -e .
# install pgbelt in your virtualenv (uses poetry)
make install

# check that belt commands work
belt --help
Expand Down
Loading

0 comments on commit 07f9a10

Please sign in to comment.