Skip to content

Commit 77f387c

Browse files
Merge pull request #154 from pepkit/dev
Release 0.12.4
2 parents 4d658d1 + 6f152ca commit 77f387c

File tree

8 files changed

+29
-9
lines changed

8 files changed

+29
-9
lines changed

.github/workflows/black.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ jobs:
66
lint:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v4
10-
- uses: actions/setup-python@v5
9+
- uses: actions/checkout@v6
10+
- uses: actions/setup-python@v6
1111
- uses: psf/black@stable

.github/workflows/cli-coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
2626

2727
steps:
28-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v6
2929

30-
- uses: actions/setup-python@v1
30+
- uses: actions/setup-python@v6
3131
with:
3232
python-version: '3.10'
3333

.github/workflows/pytest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626
- 5432:5432
2727
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
2828
steps:
29-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v6
3030

3131
- name: Set up Python ${{ matrix.python-version }}
32-
uses: actions/setup-python@v2
32+
uses: actions/setup-python@v6
3333
with:
3434
python-version: ${{ matrix.python-version }}
3535

.github/workflows/python-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ jobs:
1111
permissions:
1212
id-token: write
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v6
1515
- name: Set up Python
16-
uses: actions/setup-python@v2
16+
uses: actions/setup-python@v6
1717
with:
1818
python-version: '3.x'
1919
- name: Install dependencies

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ to increase readability, maintainability, and user experience of pepdbagent, whi
4848
- <u>Sample</u>: Handles the creation, modification, and deletion of samples, without modification of the entire project.
4949
- <u>View</u>: Manages the creation, modification, and deletion of views for specific projects.
5050
- <u>User</u>: Contains user-related information such as favorites and other user-related data.
51+
- <u>Schema</u>: Provides information and functions related to the user schemas.
5152

5253
## Example:
5354

docs/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format.
44

5+
## [0.12.4] -- 2026-01-26
6+
- Added project search by tag in annotation module
7+
- Updated github actions workflows
8+
9+
510
## [0.12.3] -- 2025-04-03
611
- Fixed models for schema records and versions
712

pepdbagent/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.12.3"
1+
__version__ = "0.12.4"

pepdbagent/modules/annotation.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def get(
106106
count=self._count_projects(
107107
namespace=namespace,
108108
search_str=query,
109+
tag=tag,
109110
admin=admin,
110111
filter_by=filter_by,
111112
filter_end_date=filter_end_date,
@@ -115,6 +116,7 @@ def get(
115116
results=self._get_projects(
116117
namespace=namespace,
117118
search_str=query,
119+
tag=tag,
118120
admin=admin,
119121
offset=offset,
120122
limit=limit,
@@ -235,6 +237,7 @@ def _count_projects(
235237
self,
236238
namespace: str = None,
237239
search_str: str = None,
240+
tag: str = None,
238241
admin: Union[str, List[str]] = None,
239242
filter_by: Optional[Literal["submission_date", "last_update_date"]] = None,
240243
filter_start_date: Optional[str] = None,
@@ -246,6 +249,7 @@ def _count_projects(
246249
247250
:param namespace: namespace where to search for a project
248251
:param search_str: search string. will be searched in name, tag and description information
252+
:param tag: tag of the projects (find projects with specific tag)
249253
:param admin: string or list of admins [e.g. "Khoroshevskyi", or ["doc_adin","Khoroshevskyi"]]
250254
:param filter_by: data to use filter on.
251255
Options: ["submission_date", "last_update_date"]
@@ -270,6 +274,8 @@ def _count_projects(
270274
)
271275
if pep_type:
272276
statement = statement.where(Projects.pop.is_(pep_type == "pop"))
277+
if tag:
278+
statement = statement.where(Projects.tag == tag)
273279
result = self._pep_db_engine.session_execute(statement).first()
274280

275281
try:
@@ -280,6 +286,7 @@ def _count_projects(
280286
def _get_projects(
281287
self,
282288
namespace: str = None,
289+
tag: str = None,
283290
search_str: str = None,
284291
admin: Union[str, List[str]] = None,
285292
limit: int = DEFAULT_LIMIT,
@@ -295,6 +302,7 @@ def _get_projects(
295302
Get projects by providing search string.
296303
297304
:param namespace: namespace where to search for a project
305+
:param tag: tag of the projects (find projects with specific tag)
298306
:param search_str: search string that has to be found in the name or tag
299307
:param admin: True, if user is admin of the namespace [Default: False]
300308
:param limit: limit of return results
@@ -322,6 +330,7 @@ def _get_projects(
322330
namespace=namespace,
323331
search_str=search_str,
324332
admin_list=admin,
333+
tag=tag,
325334
)
326335
statement = self._add_date_filter_if_provided(
327336
statement, filter_by, filter_start_date, filter_end_date
@@ -406,6 +415,7 @@ def _add_condition(
406415
namespace: str = None,
407416
search_str: str = None,
408417
admin_list: Union[str, List[str]] = None,
418+
tag: str = None,
409419
) -> Select:
410420
"""
411421
Add where clause to sqlalchemy statement (in project search)
@@ -414,6 +424,7 @@ def _add_condition(
414424
:param namespace: project namespace sql:(where namespace = "")
415425
:param search_str: search string that has to be found in the name or tag
416426
:param admin_list: list or string of admin rights to namespace
427+
:param tag: tag of the projects (find projects with specific tag)
417428
:return: sqlalchemy representation of a SELECT statement with where clause.
418429
"""
419430
admin_list = tuple_converter(admin_list)
@@ -428,6 +439,9 @@ def _add_condition(
428439
if namespace:
429440
statement = statement.where(Projects.namespace == namespace)
430441

442+
if tag:
443+
statement = statement.where(Projects.tag == tag)
444+
431445
statement = statement.where(
432446
or_(Projects.private.is_(False), Projects.namespace.in_(admin_list))
433447
)

0 commit comments

Comments
 (0)