Coder Social home page Coder Social logo

ansible-role-poetry's Introduction

Poetry

Sets up the poetry environment.

Own actions

Once installed you are responsible for adding the poetry paths to your PATH environment.

export PATH="$HOME/.local/bin:$PATH"

Requirements

  • python3
  • curl

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

virtualenvs_in_project: false
virtualenvs_prefer_active_python: false
poetry_ohmyzsh_plugin: false

The top two are setting poetry configuration settings. The poetry_ohmyzsh_plugin flag can be used to enable poetry for ohmyzsh.

Dependencies

If homebrew (MacOS) was used to install poetry, it would not install it again using the 'normal' installer.

Example Playbook

- hosts: localhost
  roles:
    - role: bartdorlandt.poetry

or with variables:

- hosts: localhost
  roles:
    - role: bartdorlandt.poetry
      vars:
        virtualenvs_in_project: true
        virtualenvs_prefer_active_python: true
        poetry_ohmyzsh_plugin: true

License

MIT/BSD

Author Information

This role was created in 2022 by Bart Dorlandt.

ansible-role-poetry's People

Contributors

bartdorlandt avatar hongbo-miao avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

ansible-role-poetry's Issues

Matching Poetry parameter default values

Currently I saw in readme, it has two parameters which are set to true`, however, the default values in Poetry are different.

Just a suggestion, it would be great to match Poetry parameter default values. So that people won't be surprised when not pass any parameters by default. Thanks! πŸ˜ƒ

Illegal option -o pipefail

I am setting up Ubuntu 22.04 by

- name: Install packages
  hosts: hm-ubuntu
  roles:
    - role: staticdev.pyenv
      pyenv_version: v2.3.23
      pyenv_env: user
      pyenv_python_versions:
        - 3.11.4
      pyenv_global:
        - 3.11.4
    - role: bartdorlandt.poetry
      vars:
        virtualenvs_inproject: false
        virtualenvs_prefer_active_python: false

And got error

TASK [bartdorlandt.poetry : Install Poetry] ************************************
fatal: [hm-ubuntu]: FAILED! => {"changed": true, "cmd": "set -o pipefail && curl -sSL https://install.python-poetry.org | python3 -", "delta": "0:00:00.002447", "end": "2023-08-03 16:18:11.426375", "msg": "non-zero return code", "rc": 2, "start": "2023-08-03 16:18:11.423928", "stderr": "/bin/sh: 1: set: Illegal option -o pipefail", "stderr_lines": ["/bin/sh: 1: set: Illegal option -o pipefail"], "stdout": "", "stdout_lines": []}

However, I can run set -o pipefail && curl -sSL https://install.python-poetry.org | python3 - directly in this Ubuntu:

set -o pipefail && curl -sSL https://install.python-poetry.org | python3 -
Retrieving Poetry metadata

# Welcome to Poetry!

This will download and install the latest version of Poetry,
a dependency and package manager for Python.

It will add the `poetry` command to Poetry's bin directory, located at:

/home/parallels/.local/bin

You can uninstall at any time by executing this script with the --uninstall option,
and these changes will be reverted.

Installing Poetry (1.5.1): Creating environment
# ...

Any ideas? Thanks! ☺️

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.