Skip to content
This repository was archived by the owner on Mar 30, 2025. It is now read-only.

Commit 7726ad8

Browse files
authored
Merge pull request #256 from staticdev/feature/add-hatch-install
Add hatch install
2 parents 489fa91 + c88662c commit 7726ad8

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Ansible role to install packages for developing in Python using [Cookiecutter Hy
1111
Installs:
1212

1313
- [Cookiecutter]
14+
- [Hatch]
1415
- [Nox]
1516
- [Pipx]
1617
- [Poetry]
@@ -72,6 +73,7 @@ _Ansible role Python developer_ is free and open source software.
7273
7374
[cookiecutter]: https://github.com/audreyr/cookiecutter
7475
[cookiecutter hypermodern python]: https://github.com/cjolowicz/cookiecutter-hypermodern-python
76+
[hatch]: https://hatch.pypa.io
7577
[linux workstation playbook]: https://github.com/staticdev/linux-workstation-playbook
7678
[mit]: https://opensource.org/licenses/MIT
7779
[nox]: https://nox.thea.codes/

meta/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ galaxy_info:
2424
- development
2525
- developer
2626
- cookiecutter
27+
- hatch
2728
- nox
2829
- poetry
2930
- pyenv

molecule/default/molecule.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ driver:
77
name: podman
88
platforms:
99
- name: instance
10-
image: "docker.io/geerlingguy/docker-${MOLECULE_DISTRO:-debian11}-ansible:latest"
10+
image: "docker.io/geerlingguy/docker-${MOLECULE_DISTRO:-debian12}-ansible:latest"
1111
command: ${MOLECULE_COMMAND:-""}
1212
volumes:
1313
- /sys/fs/cgroup:/sys/fs/cgroup:ro

tasks/main.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,28 @@
4949
when: pre_commit_check is failed
5050

5151
- name: Check if cookiecutter is installed
52-
ansible.builtin.stat:
53-
path: "{{ ansible_env.HOME }}/.local/pipx/venvs/cookiecutter"
54-
register: cookiecutter_folder_check
52+
ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/cookiecutter --version"
53+
register: cookiecutter_cmd
54+
changed_when: false
5555
ignore_errors: true
5656

5757
- name: Install cookiecutter
5858
ansible.builtin.command: "{{ pipx_path }}/pipx install cookiecutter"
5959
register: output
6060
changed_when: "output.rc == 0"
61-
when: cookiecutter_folder_check is failed
61+
when: cookiecutter_cmd is failed
62+
63+
- name: Check if hatch is installed
64+
ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/hatch --version"
65+
register: hatch_cmd
66+
changed_when: false
67+
ignore_errors: true
68+
69+
- name: Install hatch
70+
ansible.builtin.command: "{{ pipx_path }}/pipx install hatch"
71+
register: output
72+
changed_when: "output.rc == 0"
73+
when: hatch_cmd is failed
6274

6375
- name: Check if poetry is installed
6476
ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/poetry"

0 commit comments

Comments
 (0)