Skip to content

Commit fd4ac10

Browse files
committed
Update README instructions for running Hatch commands
Signed-off-by: Webster Mudge <[email protected]>
1 parent a8df84d commit fd4ac10

File tree

1 file changed

+43
-15
lines changed

1 file changed

+43
-15
lines changed

README.md

Lines changed: 43 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -118,38 +118,66 @@ For example, here we use the
118118
> [!IMPORTANT]
119119
> The CDP modules expect standard CDP authentication configurations, e.g. `CDP_PROFILE`, as described by the *Configuring* section of [CDP CLI/SDK](https://github.com/cloudera/cdpcli#configuring).
120120

121-
## Building the Collection
121+
## Building and Developing the Collection
122122

123-
To create a local collection tarball, run:
123+
To develop the collection -- additions, updates, bugfixes, etc. -- or to build resources from the collections -- API documentation, etc. -- you must first install [Hatch](https://hatch.pypa.io/latest/) according to your specific development environment.
124124

125125
```bash
126-
ansible-galaxy collection build
126+
# As a Python application
127+
pip install hatch
128+
129+
# With Brew (OSX)
130+
brew install hatch
131+
132+
# On Fedora
133+
sudo dnf install hatch
127134
```
128135

129-
## Building the API Documentation
136+
### Developing Collection Resources
130137

131-
To create a local copy of the API documentation, first make sure the collection is in your `ANSIBLE_COLLECTIONS_PATHS`. Then run the following:
138+
To set up a development environment, you can first use the following to install the Python dependencies:
132139

133140
```bash
134-
# change into the /docsbuild directory
135-
cd docsbuild
141+
hatch shell
142+
```
143+
144+
This will create a `hatch`-managed virtual environment. (You can also associate this Python environment with your IDE, like VSCode!)
145+
146+
> [!TIP]
147+
> You also need to ensure the collection's project directory is in your `ANSIBLE_COLLECTIONS_PATH` variable.
148+
149+
While you develop and work on collection resources, you can easily execute checks and linters with the following command:
150+
151+
```bash
152+
hatch run lint
153+
```
136154

137-
# install the build requirements (antsibull-docs); you may want to set up a
138-
# dedicated virtual environment
139-
pip install ansible-core https://github.com/cloudera-labs/antsibull-docs/archive/cldr-docsite.tar.gz
155+
This script will run a number of `pre-commit` hooks, including `ansible-lint`, as well as lint any API documentation, guides, and other resources.
140156

141-
# Install the collection's build dependencies
142-
pip install -r requirements.txt
157+
If you wish to contribute your changes, please check out the instructions in the [CONTRIBUTING](./CONTRIBUTING.md) guide.
143158

144-
# Then run the build script
145-
./build.sh
159+
### Building the API Documentation
160+
161+
To create a local copy of the API documentation, first make sure the project, i.e. the collection, is in your `ANSIBLE_COLLECTIONS_PATH`. Then run the following:
162+
163+
```bash
164+
hatch run docs:build
146165
```
147166

148167
Your local documentation will be found at `docsbuild/build/html`.
149168

169+
170+
### Building the Collection Bundle
171+
172+
To create a local collection tarball, run:
173+
174+
```bash
175+
ansible-galaxy collection build
176+
```
177+
150178
## License and Copyright
151179

152-
Copyright 2023, Cloudera, Inc.
180+
Copyright 2025, Cloudera, Inc.
153181

154182
```
155183
Licensed under the Apache License, Version 2.0 (the "License");

0 commit comments

Comments
 (0)