Skip to content

Commit

Permalink
Add deprecation warning for link feature
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Feb 26, 2021
1 parent 318bffb commit 6b7d8ac
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 6 deletions.
11 changes: 8 additions & 3 deletions docs/use-cases/multiple-links.md
Expand Up @@ -4,14 +4,18 @@ This feature can be used to create as many symbolic links as you need from one r

## The syntax

Let's say we have a simple project structure.
Let's say we have a simple project structure:

```text
|- include
|- src
|- docs
```

with the following `gitman.yml`:

```yaml
location: .gitman
location: .gitman

sources:
- repo: <URL of my_dependency repository>
Expand All @@ -24,13 +28,14 @@ sources:
```

This will result in the following symbolic links:

- `<root>/vendor/partial_repo` -> `<root>/.gitman/my_dependency/include`
- `<root>/vendor/full_repo` -> `<root>/.gitman/my_dependency`

## Alternative syntax

```yaml
location: vendor
location: vendor

sources:
- repo: <URL of my_dependency repository>
Expand Down
4 changes: 2 additions & 2 deletions gitman.yml
Expand Up @@ -6,7 +6,7 @@ sources:
type: git
sparse_paths:
-
link:
link: demo/example
links:
-
scripts:
Expand Down Expand Up @@ -53,7 +53,7 @@ sources_locked:
type: git
sparse_paths:
-
link:
link: demo/example
links:
-
scripts:
Expand Down
6 changes: 6 additions & 0 deletions gitman/models/source.py
@@ -1,4 +1,5 @@
import os
import warnings
from dataclasses import dataclass, field
from typing import List, Optional

Expand Down Expand Up @@ -37,6 +38,11 @@ def __post_init__(self):
else:
self.name = str(self.name)
self.type = self.type or 'git'
if self.link:
warnings.warn(
"'link' will be replaced with 'links' in version 3.0",
DeprecationWarning,
)

def __repr__(self):
return "<source {}>".format(self)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
@@ -1,7 +1,7 @@
[tool.poetry]

name = "gitman"
version = "2.3b4"
version = "2.3b5"
description = "A language-agnostic dependency manager using Git."

license = "MIT"
Expand Down

0 comments on commit 6b7d8ac

Please sign in to comment.