Skip to content

Commit ef38420

Browse files
committed
dep: update 'slot' to 'slot_dep' for dep field attr naming
To match pkgcraft changes.
1 parent edac116 commit ef38420

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

src/pkgcraft/C.pxd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ cdef extern from "pkgcraft.h":
1818
DEP_FIELD_PACKAGE,
1919
DEP_FIELD_BLOCKER,
2020
DEP_FIELD_VERSION,
21-
DEP_FIELD_SLOT,
21+
DEP_FIELD_SLOT_DEP,
2222
DEP_FIELD_USE_DEPS,
2323
DEP_FIELD_REPO,
2424
ctypedef uint32_t DepField

src/pkgcraft/dep/pkg.pyx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ cdef dict DEP_FIELDS = {
6363
'package': C.DEP_FIELD_PACKAGE,
6464
'blocker': C.DEP_FIELD_BLOCKER,
6565
'version': C.DEP_FIELD_VERSION,
66-
'slot': C.DEP_FIELD_SLOT,
66+
'slot_dep': C.DEP_FIELD_SLOT_DEP,
6767
'use_deps': C.DEP_FIELD_USE_DEPS,
6868
'repo': C.DEP_FIELD_REPO,
6969
}
@@ -172,7 +172,7 @@ cdef class Dep:
172172
173173
Args:
174174
fields: The supported attribute names include the following:
175-
blocker, version, slot, use_deps, and repo.
175+
blocker, version, slot_dep, use_deps, and repo.
176176
177177
Returns:
178178
Dep: The package dependency without the specified atttributes, if
@@ -190,7 +190,7 @@ cdef class Dep:
190190
'cat/pkg:4/5[a,b]'
191191
>>> str(d.without("use_deps", "version"))
192192
'cat/pkg:4/5'
193-
>>> str(d.without("use_deps", "version", "slot"))
193+
>>> str(d.without("use_deps", "version", "slot_dep"))
194194
'cat/pkg'
195195
"""
196196
cdef int field
@@ -223,7 +223,7 @@ cdef class Dep:
223223
kwargs: The keyword arguments must be attribute names with their corresponding
224224
string values or None for removal. Supported attribute names
225225
include the following: category, package, blocker, version,
226-
slot, use_deps, and repo. Note that removing the category or
226+
slot_dep, use_deps, and repo. Note that removing the category or
227227
package attributes will fail.
228228
229229
Returns:
@@ -243,15 +243,15 @@ cdef class Dep:
243243
'>=cat/pkg-1.2.3-r4'
244244
>>> str(d.modify(package='b', repo='repo'))
245245
'cat/b::repo'
246-
>>> str(d.modify(version='~0.1', slot='2/3=', use_deps='a,b,c', repo='test'))
246+
>>> str(d.modify(version='~0.1', slot_dep='2/3=', use_deps='a,b,c', repo='test'))
247247
'~cat/pkg-0.1:2/3=::test[a,b,c]'
248248
249249
Adding and removing attributes:
250250
251251
>>> d = Dep('>=cat/pkg-1.2-r3:4/5[a,b]')
252252
>>> str(d.modify(use_deps=None, repo='test'))
253253
'>=cat/pkg-1.2-r3:4/5::test'
254-
>>> str(d.modify(slot='3/4=', version=None))
254+
>>> str(d.modify(slot_dep='3/4=', version=None))
255255
'cat/pkg:3/4=[a,b]'
256256
"""
257257
cdef int field

tests/dep/test_pkg.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def test_parse(self):
138138
Dep.parse(obj)
139139

140140
def test_without(self):
141-
optional_fields = ("blocker", "version", "slot", "use_deps", "repo")
141+
optional_fields = ("blocker", "version", "slot_dep", "use_deps", "repo")
142142
dep = Dep("!!>=cat/pkg-1.2-r3:4/5=::repo[u]")
143143

144144
# no args returns the same object
@@ -149,7 +149,7 @@ def test_without(self):
149149
# drop specified attributes
150150
assert str(dep.without("blocker")) == ">=cat/pkg-1.2-r3:4/5=::repo[u]"
151151
assert str(dep.without("version")) == "!!cat/pkg:4/5=::repo[u]"
152-
assert str(dep.without("slot")) == "!!>=cat/pkg-1.2-r3::repo[u]"
152+
assert str(dep.without("slot_dep")) == "!!>=cat/pkg-1.2-r3::repo[u]"
153153
assert str(dep.without("use_deps")) == "!!>=cat/pkg-1.2-r3:4/5=::repo"
154154
assert str(dep.without("repo")) == "!!>=cat/pkg-1.2-r3:4/5=[u]"
155155
assert str(dep.without(*optional_fields)) == "cat/pkg"

0 commit comments

Comments
 (0)