Skip to content

Commit 96a99f2

Browse files
authored
Merge branch 'main' into main
2 parents 9403211 + 2ac8861 commit 96a99f2

File tree

11 files changed

+116
-890
lines changed

11 files changed

+116
-890
lines changed

.github/workflows/documentation.yml

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,49 +16,37 @@ jobs:
1616

1717
steps:
1818
- name: Checkout repository
19-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
2020

2121
- name: Set up Python
22-
uses: actions/setup-python@v2
22+
uses: actions/setup-python@v4
2323
with:
2424
python-version: '3.10'
2525

26-
- name: Set POETRY_CACHE_DIR
27-
run: echo "POETRY_CACHE_DIR=${{runner.temp}}/poetry_cache" >> $GITHUB_ENV
28-
- name: Install Poetry
26+
- name: Install uv and dependencies
2927
run: |
30-
curl -sSL https://install.python-poetry.org | python3 -
31-
echo "Poetry installed successfully"
32-
33-
- name: Install dependencies
34-
run: |
35-
poetry install --extras "docs"
28+
pip install uv
29+
uv venv
30+
uv pip install -e .[docs]
3631
echo "Dependencies installed successfully"
37-
env:
38-
POETRY_VIRTUALENVS_CREATE: false
39-
POETRY_CACHE_DIR: .cache/poetry
4032
4133
- name: Build documentation
4234
run: |
43-
sphinx-build -b html docs/source _build/html
35+
uv run sphinx-build -b html docs/source _build/html
4436
echo "Documentation built successfully"
4537
4638
- name: Upload Pages Artifact
47-
uses: actions/upload-pages-artifact@v1
39+
uses: actions/upload-pages-artifact@v3
4840
with:
4941
path: ./_build/html
5042

5143
deploy:
52-
needs: build
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deployment.outputs.page_url }}
5347
runs-on: ubuntu-latest
54-
55-
permissions:
56-
contents: read
57-
id-token: write
58-
pages: write
59-
48+
needs: build
6049
steps:
61-
- name: Deploy to GitHub Pages
62-
uses: actions/deploy-pages@v1
63-
with:
64-
token: ${{ secrets.GITHUB_TOKEN }}
50+
- name: Deploy to GitHub Pages
51+
id: deployment
52+
uses: actions/deploy-pages@v4

.github/workflows/poetry_update.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,25 @@ on:
33
workflow_dispatch:
44
release:
55
types: [published]
6+
67
jobs:
78
pypi:
9+
permissions:
10+
id-token: write
811
runs-on: ubuntu-latest
912
steps:
10-
- name: Checkout
11-
uses: actions/checkout@v3
12-
- name: Install poetry
13-
run: pipx install poetry
14-
- name: Setup poetry
15-
run: poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
16-
- name: Publish package
17-
run: poetry publish --build
13+
- uses: actions/checkout@v4
14+
15+
- name: Install uv and set the python version with caching
16+
uses: astral-sh/setup-uv@v5
17+
with:
18+
python-version: 3.11
19+
20+
- name: Install the project
21+
run: uv sync --all-extras
22+
23+
- name: Build
24+
run: uv build
25+
26+
- name: Publish
27+
run: uv publish

.github/workflows/tests.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,28 @@ jobs:
1212
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
1313
runs-on: ${{ matrix.platform }}
1414
steps:
15-
- uses: actions/checkout@v3
16-
- name: Set up Python ${{ matrix.python-version }}
17-
uses: actions/setup-python@v4
15+
- uses: actions/checkout@v4
16+
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v5
1819
with:
1920
python-version: ${{ matrix.python-version }}
20-
- name: Install poetry
21-
run: pipx install poetry
22-
- name: Install poetry dependencies
21+
enable-cache: true
22+
23+
- name: Install dependencies with uv
2324
run: |
24-
poetry install -E dev
25-
poetry show
25+
uv venv
26+
uv pip install -e .[dev]
27+
echo "Dependencies installed successfully"
28+
2629
- name: Setup git
2730
run: |
2831
git config --global user.name "Search-query test"
2932
git config --global user.email "actions@users.noreply.github.com"
3033
git config --global url.https://github.com/.insteadOf git://github.com/
31-
- name: Run poetry tests
32-
run: poetry run pytest test -vv
34+
35+
- name: Run tests with uv
36+
run: uv run pytest test -vv
3337

3438
pip-install:
3539
strategy:
@@ -38,19 +42,23 @@ jobs:
3842
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
3943
runs-on: ${{ matrix.platform }}
4044
steps:
41-
- uses: actions/checkout@v3
45+
- uses: actions/checkout@v4
46+
4247
- name: Set up Python ${{ matrix.python-version }}
4348
uses: actions/setup-python@v4
4449
with:
4550
python-version: ${{ matrix.python-version }}
51+
4652
- name: Install via pip
4753
run: |
4854
pip install -e .[dev]
4955
pip list
56+
5057
- name: Setup git
5158
run: |
5259
git config --global user.name "Search-query test"
5360
git config --global user.email "actions@users.noreply.github.com"
5461
git config --global url.https://github.com/.insteadOf git://github.com/
62+
5563
- name: Run tests
5664
run: pytest test -vv

.pre-commit-hooks.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- id: search-file-lint
2+
name: lint search files
3+
description: Linter for search files based on the search-query package.
4+
entry: search-file-lint
5+
language: python
6+
stages: [pre-commit, pre-push, manual]
7+
minimum_pre_commit_version: 3.2.0

README.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Welcome to search-query
2-
31
<div align="center">
42

3+
# search-query
4+
55
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/CoLRev-Environment/search-query/.github%2Fworkflows%2Ftests.yml?label=tests)](https://github.com/CoLRev-Environment/search-query/actions/workflows/tests.yml)
66
[![GitHub Release](https://img.shields.io/github/v/release/CoLRev-Environment/search-query)](https://github.com/CoLRev-Environment/search-query/releases/)
77
[![PyPI - Version](https://img.shields.io/pypi/v/search-query?color=blue)](https://pypi.org/project/search-query/)
@@ -39,10 +39,8 @@ query = AndQuery([digital_synonyms, work_synonyms], search_field="Author Keyword
3939

4040
Parameters:
4141

42-
- list of strings or queries: strings which you want to include in the search query,
43-
- search field: search field to which the query should be applied (available options: TODO: GIVE EXAMPLES AND LINK TO DOCS)
44-
45-
**TODO : implement a user-friendly version of OrQuery / AndQuery, which accepts lists of strings/queries and search_fields as strings**
42+
- list of strings or queries: strings that you want to include in the search query,
43+
- `search_field`: search field to which the query should be applied (available options: TODO: GIVE EXAMPLES AND LINK TO DOCS)
4644

4745
To load a JSON query file, run the parser:
4846

@@ -107,7 +105,18 @@ search-query lint search-file.json
107105

108106
Linters can be included as pre-commit hooks by adding the following to the `.pre-commit-config.yaml:
109107

108+
```yaml
109+
repos:
110+
- repo: https://github.com/CoLRev-Environment/search-query
111+
rev: main # or version of search-query
112+
hooks:
113+
- id: search-file-lint
114+
110115
```
116+
117+
For development and testing, use the following:
118+
119+
```yaml
111120
repos:
112121
- repo: local
113122
hooks:
@@ -118,17 +127,6 @@ repos:
118127
files: \.json$
119128
```
120129
121-
<!--
122-
TODO: the previous one should be for dev. Enable (based on [.pre-commit-hooks.yaml](https://github.com/pre-commit/pre-commit-hooks/blob/main/.pre-commit-hooks.yaml)):
123-
124-
```
125-
- repo: https://github.com/pre-commit/pre-commit-hooks
126-
rev: v4.6.0 # Use the ref you want to point at
127-
hooks:
128-
- id: trailing-whitespace
129-
```
130-
-->
131-
132130
To activate and run:
133131
134132
```
@@ -154,7 +152,7 @@ The package was developed as part of Bachelor's theses:
154152

155153
## Not what you are looking for?
156154

157-
This python package was developed with purpose of integrating it into other literature management tools. If that isn't your use case, it migth be useful for you to look at these related tools:
155+
This Python package was developed with purpose of integrating it into other literature management tools. If that isn't your use case, it might be useful for you to look at these related tools:
158156

159157
- [LitSonar](https://litsonar.com/)
160158
- [Polyglot](https://sr-accelerator.com/#/polyglot)

0 commit comments

Comments
 (0)