Skip to content

Commit 086cc0b

Browse files
allRiscBen Davis
andauthored
Updated the registry documentation to show how to configure registries. (#8)
Co-authored-by: Ben Davis <b-davis1@ti.com>
1 parent 09a8f32 commit 086cc0b

2 files changed

Lines changed: 133 additions & 3 deletions

File tree

docs/source/manifest_reference/manifest_format.rst

Lines changed: 132 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ The ``authors`` field accepts several formats:
9999
100100
[package]
101101
authors = "John Doe"
102-
102+
103103
# Or with email:
104104
authors = "John Doe <john.doe@example.com>"
105105
@@ -119,7 +119,7 @@ The ``authors`` field accepts several formats:
119119
120120
[package]
121121
authors = {name = "John Doe", email = "john.doe@example.com"}
122-
122+
123123
# Email is optional:
124124
authors = {name = "John Doe"}
125125
@@ -273,4 +273,134 @@ The ``[registries]`` section
273273
Additional registries can be specified in the ``[registries]`` section.
274274
A registry type exists for each :ref:`dependency specifier <specifying_dependencies>` type.
275275

276+
The ``[registries]`` section manages custom registries used to locate and fetch dependencies.
277+
FastSandPM supports three types of registries: Git registries, Package Index registries, and Path registries.
278+
Default registries (GitHub, GitLab, Bitbucket, and a local path registry) are automatically added if not explicitly provided.
279+
280+
281+
Git Registries
282+
^^^^^^^^^^^^^^
283+
284+
Git registries are used to resolve dependencies from git hosts such as GitHub, GitLab, or custom Git servers.
285+
286+
A Git registry consists of the unique registry name and then the url to the remote root.
287+
The remote is specified as a url in a inline TOML table.
288+
289+
Example TOML with custom Git registry:
290+
291+
.. code-block:: TOML
292+
293+
[registries]
294+
internal-git = {remote = "https://git.company.com"}
295+
296+
Once defined, the registry can be referenced in dependency specifications:
297+
298+
.. code-block:: TOML
299+
300+
[dependencies]
301+
my-lib = {git = "my-org"} # Uses internal-git registry if https://git.company.com/my-org/my-lib exists
302+
other-lib = {git = "my-org/"}
303+
304+
305+
Package Index Registries
306+
^^^^^^^^^^^^^^^^^^^^^^^^
307+
308+
.. warning::
309+
310+
Package Index registries are not yet fully supported. All methods currently raise ``NotImplementedError`` as this feature is still under development.
311+
312+
Package Index registries are used to resolve dependencies from package indices similar to PyPI or JFrog Artifactory.
313+
314+
A package index registry consists of the unique registry name and then the url index to the index.
315+
The index is specified as a url in a inline TOML table.
316+
317+
Example TOML with Package Index registry:
318+
319+
.. code-block:: TOML
320+
321+
[registries]
322+
323+
artifactory = {index = "https://artifactory.company.com/artifactory/api/pypi/pypi"}
324+
325+
Once defined, the registry can be referenced in dependency specifications:
326+
327+
.. code-block:: TOML
328+
329+
[dependencies]
330+
my-lib = {index = "artifactory", version = "1.0.0"}
331+
332+
333+
Path Registries
334+
^^^^^^^^^^^^^^^
335+
336+
Path registries are used to resolve dependencies from local filesystem paths.
337+
This is useful for monorepo setups or local development where dependencies are checked out locally.
338+
339+
A path registry consists of the unique registry name and then the path to the local repository.
340+
The path is specified as a relative path from the current project in a inline TOML table.
341+
342+
Example TOML with Path registry:
343+
344+
.. code-block:: TOML
345+
346+
[registries]
347+
local-deps = {path = "./local_dependencies"}
348+
349+
Once defined, the registry can be used in dependency specifications:
350+
351+
.. code-block:: TOML
352+
353+
[dependencies]
354+
local-util = {path = "./util"} # Uses local-deps registry
355+
356+
357+
Complete Registry Example
358+
^^^^^^^^^^^^^^^^^^^^^^^^^
359+
360+
Here is a complete example showing all three registry types in use:
361+
362+
.. code-block:: TOML
363+
364+
[package]
365+
name = "my-project"
366+
version = "1.0.0"
367+
368+
[registries]
369+
# Internal Git registry
370+
internal-git = {remote = "https://git.company.com"}
371+
372+
# Monorepo registry
373+
local-deps = {path = "./monorepo/libraries"}
374+
375+
# Package Index registry (for future use)
376+
artifactory = {index = "https://artifactory.company.com/api/pypi"}
377+
378+
[dependencies]
379+
# From GitHub (default registry)
380+
public-lib = {git = "github-org"}
381+
382+
# From internal Git server (can match to https://git.company.com/internal-org/internal-lib.git)
383+
internal-lib = {git = "internal-org"}
384+
385+
# From local path (can match to ./monorepo/libraries/util)
386+
local-util = {path = "./util"}
387+
388+
Default Registries
389+
^^^^^^^^^^^^^^^^^^^
390+
391+
FastSandPM automatically adds the following default registries:
392+
393+
- **github**: ``https://github.com``
394+
- **gitlab**: ``https://gitlab.com``
395+
- **bitbucket**: ``https://bitbucket.org``
396+
- **local_path**: ``.`` (current directory)
397+
398+
To use a default registry, simply reference it by name in your dependency specifications.
399+
For example, to fetch from GitHub:
400+
401+
.. code-block:: TOML
402+
403+
[dependencies]
404+
my-lib = {git = "my-org/my-lib"} # Resolved via the default GitHub registry
405+
276406

src/fastsandpm/registries.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def parse_dependencies(cls, data: Any) -> Any:
162162
new_data.append({"name": name, "index": spec})
163163
else:
164164
# Pass through as-is (will fail validation if invalid)
165-
new_data.append({"name": name, "version": spec})
165+
new_data.append({"name": name, "index": spec})
166166
return new_data
167167

168168
return data

0 commit comments

Comments
 (0)