Skip to content

Commit 79c3184

Browse files
committed
refactor!: Rename states -> projects
1 parent 308b469 commit 79c3184

File tree

22 files changed

+50
-46
lines changed

22 files changed

+50
-46
lines changed

CHANGES

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ $ pip install --user --upgrade --pre libvcs
1616
### Breaking
1717

1818
- `GitRepo`, `SVNRepo`, `MercurialRepo`, `BaseRepo` have been moved to
19-
`libvcs.states.{module}.{Module}Repo`
19+
`libvcs.projects.{module}.{Module}Repo`
2020
- `repo_dir` param is renamed to `dir`:
2121

2222
Before: `GitRepo(url='...', repo_dir='...')`
@@ -26,7 +26,7 @@ $ pip install --user --upgrade --pre libvcs
2626
{issue}`#324`
2727

2828
- `dir` to `pathlib`, `BaseRepo.path` -> `BaseRepo.dir`
29-
- Logging functions moved to {attr}`libvcs.states.base.BaseRepo.log` ({issue}`#322`)
29+
- Logging functions moved to {attr}`libvcs.projects.base.BaseRepo.log` ({issue}`#322`)
3030
- Rename `RepoLoggingAdapter` to `CmdLoggingAdapter`
3131
- `CmdLoggingAdapter`: Rename `repo_name` param to `keyword`
3232

@@ -51,7 +51,7 @@ $ pip install --user --upgrade --pre libvcs
5151
- {meth}`libvcs.cmd.hg.Hg.run`
5252
- {meth}`libvcs.cmd.hg.Hg.clone`
5353

54-
- {class}`libvcs.states.git.GitRepo` now accepts remotes in `__init__`
54+
- {class}`libvcs.projects.git.GitRepo` now accepts remotes in `__init__`
5555

5656
```python
5757
repo = GitRepo(
@@ -76,7 +76,7 @@ $ pip install --user --upgrade --pre libvcs
7676
)
7777
```
7878

79-
- {meth}`libvcs.states.git.GitRepo.update_repo` now accepts `set_remotes=True`
79+
- {meth}`libvcs.projects.git.GitRepo.update_repo` now accepts `set_remotes=True`
8080

8181
### Compatibility
8282

@@ -94,9 +94,9 @@ $ pip install --user --upgrade --pre libvcs
9494
({issue}`#316`)
9595
- New constants for `str` -> class mappings
9696

97-
- {data}`libvcs.states.constants.DEFAULT_VCS_CLASS_MAP`
98-
- {data}`libvcs.states.constants.DEFAULT_VCS_CLASS_UNION`
99-
- {data}`libvcs.states.constants.DEFAULT_VCS_LITERAL`
97+
- {data}`libvcs.projects.constants.DEFAULT_VCS_CLASS_MAP`
98+
- {data}`libvcs.projects.constants.DEFAULT_VCS_CLASS_UNION`
99+
- {data}`libvcs.projects.constants.DEFAULT_VCS_LITERAL`
100100

101101
- Remove tox and tox-poetry-installer. It turns out installing poetry inside a poetry project
102102
doesn't work well. (`poetry update`, `poetry publish`, etc. commands would fail)

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ git = Git(dir=pathlib.Path.cwd() / 'my_git_repo')
3939
git.clone(url='https://github.com/vcs-python/libvcs.git')
4040
```
4141

42-
## States
42+
## Projects
4343

44-
Create a [`GitRepo`](https://libvcs.git-pull.com/states/git.html#libvcs.states.git.GitRepo) object
45-
of the project to inspect / checkout / update:
44+
Create a [`GitRepo`](https://libvcs.git-pull.com/projects/git.html#libvcs.projects.git.GitRepo)
45+
object of the project to inspect / checkout / update:
4646

4747
```python
4848
import pathlib
49-
from libvcs.states.git import GitRepo
49+
from libvcs.projects.git import GitRepo
5050

5151
repo = GitRepo(
5252
url="https://github.com/vcs-python/libvcs",

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
1111
quickstart
1212
cmd/index
13-
states/index
13+
projects/index
1414
```
1515

1616
```{toctree}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# `libvcs.states.base`
1+
# `libvcs.projects.base`
22

3-
Base objects / classes for states.
3+
Base objects / classes for projects.
44

55
Adding your own VCS / Extending libvcs can be done through subclassing `BaseRepo`.
66

77
```{eval-rst}
88
.. autosummary::
99
:recursive:
1010
11-
libvcs.states.base.BaseRepo
11+
libvcs.projects.base.BaseRepo
1212
```
1313

1414
```{eval-rst}
15-
.. automodule:: libvcs.states.base
15+
.. automodule:: libvcs.projects.base
1616
:members:
1717
:show-inheritance:
1818
```

docs/states/git.md renamed to docs/projects/git.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
# `libvcs.states.git`
1+
# `libvcs.projects.git`
22

33
For `git(1)`.
44

55
Compare to:
66
[`fabtools.require.git`](https://fabtools.readthedocs.io/en/0.19.0/api/require/git.html),
7-
[`salt.states.git`](https://docs.saltproject.io/en/latest/ref/states/all/salt.states.git.html),
7+
[`salt.projects.git`](https://docs.saltproject.io/en/latest/ref/projects/all/salt.projects.git.html),
88
[`ansible.builtin.git`](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/git_module.html)
99

1010
```{eval-rst}
1111
.. autosummary::
1212
:recursive:
1313
14-
libvcs.states.git.GitRemote
15-
libvcs.states.git.GitRepo
14+
libvcs.projects.git.GitRemote
15+
libvcs.projects.git.GitRepo
1616
```
1717

1818
```{eval-rst}
19-
.. automodule:: libvcs.states.git
19+
.. automodule:: libvcs.projects.git
2020
:members:
2121
:show-inheritance:
2222
:undoc-members:

docs/states/hg.md renamed to docs/projects/hg.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# `libvcs.states.hg`
1+
# `libvcs.projects.hg`
22

33
For mercurial, aka `hg(1)`.
44

55
```{eval-rst}
66
.. autosummary::
77
:recursive:
88
9-
libvcs.states.hg.MercurialRepo
9+
libvcs.projects.hg.MercurialRepo
1010
```
1111

1212
```{eval-rst}
13-
.. automodule:: libvcs.states.hg
13+
.. automodule:: libvcs.projects.hg
1414
:members:
1515
:show-inheritance:
1616
:undoc-members:

docs/states/index.md renamed to docs/projects/index.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
(states)=
1+
(projects)=
22

3-
# `libvcs.states`
3+
# `libvcs.projects`
44

55
Compare to:
66
[`fabtools.require.git`](https://fabtools.readthedocs.io/en/0.19.0/api/require/git.html),
7-
[`salt.states.git`](https://docs.saltproject.io/en/latest/ref/states/all/salt.states.git.html),
7+
[`salt.projects.git`](https://docs.saltproject.io/en/latest/ref/projects/all/salt.projects.git.html),
88
[`ansible.builtin.git`](https://docs.ansible.com/ansible/latest/collections/ansible/builtin/git_module.html)
99

1010
:::{warning}
@@ -38,7 +38,7 @@ See examples below of git, mercurial, and subversion.
3838
## Constants
3939

4040
```{eval-rst}
41-
.. automodule:: libvcs.states.constants
41+
.. automodule:: libvcs.projects.constants
4242
:members:
4343
```
4444

docs/states/svn.md renamed to docs/projects/svn.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# `libvcs.states.svn`
1+
# `libvcs.projects.svn`
22

33
For subversion, aka `svn(1)`
44

55
```{eval-rst}
66
.. autosummary::
77
:recursive:
88
9-
libvcs.states.svn.SubversionRepo
9+
libvcs.projects.svn.SubversionRepo
1010
```
1111

1212
```{eval-rst}
13-
.. automodule:: libvcs.states.svn
13+
.. automodule:: libvcs.projects.svn
1414
:members:
1515
:show-inheritance:
1616
:undoc-members:

docs/redirects.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
"api.md" "states/index.md"
2-
"api/base.md" "states/base.md"
3-
"api/git.md" "states/git.md"
4-
"api/hg.md" "states/hg.md"
5-
"api/svn.md" "states/svn.md"
1+
"api.md" "projects/index.md"
2+
"api/base.md" "projects/base.md"
3+
"api/git.md" "projects/git.md"
4+
"api/hg.md" "projects/hg.md"
5+
"api/svn.md" "projects/svn.md"

libvcs/__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
import logging
33

44
from .cmd.core import CmdLoggingAdapter
5-
from .states.base import BaseRepo
6-
from .states.git import GitRepo
7-
from .states.hg import MercurialRepo
8-
from .states.svn import SubversionRepo
5+
from .projects.base import BaseRepo
6+
from .projects.git import GitRepo
7+
from .projects.hg import MercurialRepo
8+
from .projects.svn import SubversionRepo
99

1010
__all__ = [
1111
"GitRepo",

0 commit comments

Comments
 (0)