Skip to content

initialcapacity/multiproject-python

Repository files navigation

Multi-project Python

Local development

  1. Install PostgreSQL, Python and Poetry

    brew install postgresql@15 pyenv
    pyenv install 3.10
    # Add pyenv to the path
    pyenv shell 3.10
    curl -sSL https://install.python-poetry.org | python3 -
  2. Install Python dependencies

    make install
  3. Set up database

    make db/reset migrate
  4. Verify types and run tests

    make test
  5. Check PEP-8 compliance and code format

    make check
  6. Configure environment variables

    cp .env.example .env
    vi .env
  7. Run app

    make run

PyCharm setup

  1. In Settings → Project: multiproject-python → Python Interpreter set the Python interpreter for the top-level project to be the existing Python interpreter created via the command line.
  2. Attach each Python subproject to the IDE project with File → Open... → Attach project.... Note: On Open..., navigate to subproject, click Open and when prompted, click Attach. Repeat for each subproject.
  3. In Settings → Project: multiproject-python → Python Interpreter set the Python interpreter for each Python subproject to be the existing Python interpreter created via the command line.
  4. Manually set up dependencies between Python subprojects in Settings → Project: multiproject-python → Project Dependencies. This is clunky, and PyCharm should be able to infer this information from the subprojects' pyproject.toml files. Watch the open issue in YouTrack for developments.
  5. In Settings → Tools → Black configure PyCharm to use the Black formatter on code reformat and on save.

Run locally with Docker

cd applications/starter_app
poetry export --without-hashes -f requirements.txt > ../../requirements.txt
cd ../..
sed -i.backup "s?$(pwd)?/workspace?" requirements.txt
pack build multiproject-python --builder=gcr.io/buildpacks/builder:v1
docker run -p 8080:8080 multiproject-python

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published