Skip to content

Instantly share code, notes, and snippets.

@nilreml
Last active December 10, 2024 13:24
Show Gist options
  • Select an option

  • Save nilreml/e00e589d3aee60e922f9d0db4f3b57b8 to your computer and use it in GitHub Desktop.

Select an option

Save nilreml/e00e589d3aee60e922f9d0db4f3b57b8 to your computer and use it in GitHub Desktop.

Revisions

  1. nilreml revised this gist Dec 10, 2024. 1 changed file with 7 additions and 5 deletions.
    12 changes: 7 additions & 5 deletions poetry
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    Bash completions:
    Add bash completions:
    mkdir -p ${XDG_DATA_HOME:-~/.local/share}/bash-completion/completions
    poetry completions bash > ${XDG_DATA_HOME:-~/.local/share}/bash-completion/completions/poetry

    @@ -8,15 +8,17 @@ Enter virtual environment:
    Exit virtual environment:
    exit

    Sync poetry.lock with pyproject.toml:
    poetry lock --no-update
    Add external source and packages using it:
    poetry source add --priority=explicit [source-name] [url]
    poetry add --source [source-name] [packages]

    Install dependencies inside virtual environment, in sync with poetry.lock:
    poetry shell
    poetry install --sync

    Sync poetry.lock with pyproject.toml:
    poetry lock --no-update

    Recreate virtual environment:
    poetry shell
    poetry env remove $(which python)
    poetry install

  2. nilreml revised this gist Jul 30, 2024. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion poetry
    Original file line number Diff line number Diff line change
    @@ -32,4 +32,6 @@ Rename main module:
    poetry shell
    poetry update
    poetry install --sync


    Install local dependency in editable-mode:
    poetry add --editable ../my-package/
  3. nilreml revised this gist Jun 11, 2024. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions poetry
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,9 @@ Recreate dependency graph (poetry.lock):
    rm poetry.lock
    poetry lock

    Show dependency graph:
    poetry show --tree

    Rename main module:
    pyproject.toml -> tool.poetry -> name
    poetry shell
  4. nilreml revised this gist Mar 25, 2024. 1 changed file with 7 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions poetry
    Original file line number Diff line number Diff line change
    @@ -23,3 +23,10 @@ Recreate virtual environment:
    Recreate dependency graph (poetry.lock):
    rm poetry.lock
    poetry lock

    Rename main module:
    pyproject.toml -> tool.poetry -> name
    poetry shell
    poetry update
    poetry install --sync

  5. nilreml revised this gist Mar 20, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion poetry
    Original file line number Diff line number Diff line change
    @@ -20,6 +20,6 @@ Recreate virtual environment:
    poetry env remove $(which python)
    poetry install

    Recreate dependency graph:
    Recreate dependency graph (poetry.lock):
    rm poetry.lock
    poetry lock
  6. nilreml revised this gist Mar 20, 2024. No changes.
  7. nilreml revised this gist Mar 20, 2024. 1 changed file with 12 additions and 12 deletions.
    24 changes: 12 additions & 12 deletions poetry
    Original file line number Diff line number Diff line change
    @@ -1,25 +1,25 @@
    Bash completions:
    - mkdir -p ${XDG_DATA_HOME:-~/.local/share}/bash-completion/completions
    - poetry completions bash > ${XDG_DATA_HOME:-~/.local/share}/bash-completion/completions/poetry
    mkdir -p ${XDG_DATA_HOME:-~/.local/share}/bash-completion/completions
    poetry completions bash > ${XDG_DATA_HOME:-~/.local/share}/bash-completion/completions/poetry

    Enter virtual environment:
    - poetry shell
    poetry shell

    Exit virtual environment:
    - exit
    exit

    Sync poetry.lock with pyproject.toml:
    - poetry lock --no-update
    poetry lock --no-update

    Install dependencies inside virtual environment, in sync with poetry.lock:
    - poetry shell
    - poetry install --sync
    poetry shell
    poetry install --sync

    Recreate virtual environment:
    - poetry shell
    - poetry env remove $(which python)
    - poetry install
    poetry shell
    poetry env remove $(which python)
    poetry install

    Recreate dependency graph:
    - rm poetry.lock
    - poetry lock
    rm poetry.lock
    poetry lock
  8. nilreml revised this gist Mar 20, 2024. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions poetry
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,9 @@ Bash completions:
    Enter virtual environment:
    - poetry shell

    Exit virtual environment:
    - exit

    Sync poetry.lock with pyproject.toml:
    - poetry lock --no-update

  9. nilreml revised this gist Mar 20, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions poetry
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,7 @@ Sync poetry.lock with pyproject.toml:
    - poetry lock --no-update

    Install dependencies inside virtual environment, in sync with poetry.lock:
    - poetry shell
    - poetry install --sync

    Recreate virtual environment:
  10. nilreml revised this gist Mar 20, 2024. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions poetry
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,15 @@ Bash completions:
    - mkdir -p ${XDG_DATA_HOME:-~/.local/share}/bash-completion/completions
    - poetry completions bash > ${XDG_DATA_HOME:-~/.local/share}/bash-completion/completions/poetry

    Enter virtual environment:
    - poetry shell

    Sync poetry.lock with pyproject.toml:
    - poetry lock --no-update

    Install dependencies inside virtual environment, in sync with poetry.lock:
    - poetry install --sync

    Recreate virtual environment:
    - poetry shell
    - poetry env remove $(which python)
  11. nilreml revised this gist Mar 20, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion poetry
    Original file line number Diff line number Diff line change
    @@ -7,6 +7,6 @@ Recreate virtual environment:
    - poetry env remove $(which python)
    - poetry install

    Resolve dependencies:
    Recreate dependency graph:
    - rm poetry.lock
    - poetry lock
  12. nilreml revised this gist Mar 20, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion poetry
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@ Bash completions:
    - mkdir -p ${XDG_DATA_HOME:-~/.local/share}/bash-completion/completions
    - poetry completions bash > ${XDG_DATA_HOME:-~/.local/share}/bash-completion/completions/poetry

    Recreate poetry virtual environment:
    Recreate virtual environment:
    - poetry shell
    - poetry env remove $(which python)
    - poetry install
  13. nilreml revised this gist Mar 20, 2024. No changes.
  14. nilreml revised this gist Mar 20, 2024. No changes.
  15. nilreml revised this gist Mar 20, 2024. No changes.
  16. nilreml revised this gist Mar 20, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions poetry
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    Bash completions:
    - mkdir -p ${XDG_DATA_HOME:-~/.local/share}/bash-completion/completions
    - poetry completions bash > ${XDG_DATA_HOME:-~/.local/share}/bash-completion/completions/poetry

    Recreate poetry virtual environment:
  17. nilreml revised this gist Mar 20, 2024. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions poetry
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,6 @@
    Bash completions:
    - poetry completions bash > ${XDG_DATA_HOME:-~/.local/share}/bash-completion/completions/poetry

    Recreate poetry virtual environment:
    - poetry shell
    - poetry env remove $(which python)
  18. nilreml revised this gist Mar 20, 2024. No changes.
  19. nilreml revised this gist Mar 20, 2024. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion poetry
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,8 @@

    Recreate poetry virtual environment:
    - poetry shell
    - poetry env remove $(which python)
    - poetry install

    Resolve dependencies:
    - rm poetry.lock
    - poetry lock
  20. nilreml revised this gist Mar 20, 2024. No changes.
  21. nilreml revised this gist Mar 20, 2024. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion poetry
    Original file line number Diff line number Diff line change
    @@ -1 +1,5 @@
    ‎‎​

    Recreate poetry virtual environment:
    - poetry shell
    - poetry env remove $(which python)
    - poetry install
  22. nilreml created this gist Mar 20, 2024.
    1 change: 1 addition & 0 deletions poetry
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    ‎‎​