Skip to main content

No project description provided

Project description

poetry-new-project

This is a small CLI utility meant to make it easier to set up a new Python project using Poetry and Pyenv.

Quickstart 🚀

  1. Prerequisite: Pyenv is already installed and configured on your system. If not, see pyenv installer.

  2. Install the package: pip install poetry-new-project

  3. Create a new project directory and cd into it: mkdir my-new-project && cd my-new-project

  4. Create a new pyenv environment + poetry project : poetry-new-project my-new-project-venv --version=3.10.6

  5. Wait for any python downloads to complete and finish the interactive poetry setup process.

  6. Code! 🎉

Inspiration (and why) 🤔

Blog Post: Pyenv & Poetry New Project Start

Over the past year or so I have found myself referencing this blog post many times to start a new python project.

This project is meant to supplant running (most) of these commands manually and to turn it into one CLI utility.

# install pyenv on your machine

curl https://pyenv.run | bash

# install python in pyenv

pyenv install 3.9.5

# create virtual environment:

pyenv virtualenv 3.9.5 hotdog-not-hotdog

# set hotdog-not-hotdog as the default virtual environment for the current directory

pyenv local hotdog-not-hotdog

# install poetry in your virtual environment

pip install poetry

# initialize project

poetry init

# install new dependencies

poetry add numpy

# install dependencies (if a pyproject.toml + poetry.lock already exists for a project)

poetry install

Build 🛠

    poetry build

Publish 📖

Note: Remember to update the version in pyproject.toml when publishing a new version.

    poetry publish --build --username $PYPI_USERNAME --password $PYPI_PASSWORD

Formatting ✨

    black poetry_new_project

License 📜

This project is licensed under the terms of the MIT license, see MIT - see License file <LICENSE>_.

TODO

  • [] - Write test cases (should run inside of Docker container)
    • starting case: base python image, no pyenv etc
      • test case 1: create virtual environment
        • poetry-new-project test1 --version 3.9.5
      • test case 2: create same virtual environment and expect failure because it is not forced
        • poetry-new-project test1 --version 3.9.5
        • assert fail
      • test case 3: create same virtual environment with force flag and ensure that environment is re-created
        • poetry-new-project test1 --version 3.9.5 --force
      • write tox test to test multiple versions of python, especially earlier versions (i.e. 3.5) since the current setting is only 3.9+
  • [] - write CI/CD pipeline
    • [] - create github action to push successfully built project to pypi
    • [] - create github action to run test cases

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

poetry-new-project-0.1.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

poetry_new_project-0.1.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file poetry-new-project-0.1.1.tar.gz.

File metadata

  • Download URL: poetry-new-project-0.1.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.1 CPython/3.10.6 Darwin/20.4.0

File hashes

Hashes for poetry-new-project-0.1.1.tar.gz
Algorithm Hash digest
SHA256 23dc087ae1395af080b3f96a65532e39ec8dd1e82be3ffb8e8a2da4cc621ede1
MD5 a13001467455d0bfe2f47b85f84cf9a1
BLAKE2b-256 d9c0c52acd0bf77870c0393def23d10b0ec515d14134df94aa2daca529ffae3a

See more details on using hashes here.

File details

Details for the file poetry_new_project-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for poetry_new_project-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 115a40f37c8bf9da3ccd8b22638ede55785a66093c3e0117e0a42af2bb952e3e
MD5 8d175078746d8808371f5536f89badda
BLAKE2b-256 64bd9981f2978489e29c454bde5a0cf219739474a1096180509f408b34968fe3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page