Skip to content

Commit 5a6cd43

Browse files
authored
feat: update tests and add uv (#21)
1 parent 76f0bf9 commit 5a6cd43

File tree

10 files changed

+417
-396
lines changed

10 files changed

+417
-396
lines changed

.github/workflows/doc.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ jobs:
1616
- uses: extractions/setup-just@v3
1717
- uses: actions/setup-python@v5
1818
with:
19-
python-version: "3.10"
19+
python-version: "3.12"
2020
- uses: actions/checkout@v4
21-
- run: |
22-
python -m pip install poetry~=1.8.4
23-
poetry install --no-ansi --sync
21+
- uses: astral-sh/setup-uv@v4
22+
- uses: extractions/setup-just@v3
23+
- run: uv sync --verbose --no-progress --locked --all-extras
2424
- run: just doc
2525
- uses: actions/configure-pages@v4
2626
- uses: actions/upload-pages-artifact@v3
2727
with:
2828
path: _doc/
2929
- uses: actions/deploy-pages@v4
30-
id: deployment
30+
id: deployment

.github/workflows/pypi.yml

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
---
2-
name: Build
2+
name: 👷🏼 pypi
33

4-
on:
5-
release:
6-
types: [created]
4+
on:
5+
release:
6+
types: [ created ]
77

8-
jobs:
9-
build:
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/setup-python@v4
13-
with:
14-
python-version: "3.10"
15-
- uses: actions/checkout@v3
16-
- name: Extract branch name
17-
shell: bash
18-
run: |
19-
echo "##[set-output name=ver;]$(echo ${GITHUB_REF#refs/*/})"
20-
id: extract_name_and_version
21-
- run: sed -i 's/0.0.0/'"${{ steps.extract_name_and_version.outputs.ver }}"'/' pyproject.toml
22-
- run: head -n 10 pyproject.toml
23-
- run: sed -i 's/0.0.0/'"${{ steps.extract_name_and_version.outputs.ver }}"'/' winregistry.py
24-
- run: python -m pip install poetry~=1.8.4
25-
- run: poetry build
26-
- run: poetry config http-basic.pypi __token__ ${{ secrets.PYPI_PASS }}
27-
- run: poetry publish
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Extract branch name
14+
shell: bash
15+
run: |
16+
echo "##[set-output name=ver;]$(echo ${GITHUB_REF#refs/*/})"
17+
id: extract_name_and_version
18+
- run: sed -i 's/0.0.0/'"${{ steps.extract_name_and_version.outputs.ver }}"'/' pyproject.toml
19+
- run: head -n 10 pyproject.toml
20+
- run: sed -i 's/0.0.0/'"${{ steps.extract_name_and_version.outputs.ver }}"'/' winregistry.py
21+
- uses: astral-sh/setup-uv@v4
22+
- run: uv python install 3.12
23+
- run: uv sync --all-extras --dev
24+
- run: uv build
25+
- run: uv publish --username __token__ --password ${{ secrets.PYPI_TOKEN }}

.github/workflows/robot.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@ jobs:
1818
- "3.12"
1919
- "3.13"
2020
steps:
21-
- uses: extractions/setup-just@v2
2221
- uses: actions/setup-python@v5
2322
with:
2423
python-version: ${{ matrix.PYTHON_VERSION }}
2524
- uses: actions/checkout@v4
26-
- run: |
27-
python -m pip install poetry~=1.8.4
28-
poetry install --no-ansi --sync
25+
- uses: astral-sh/setup-uv@v4
26+
- uses: extractions/setup-just@v3
27+
- run: uv sync --verbose --no-progress --locked --all-extras
2928
- run: just tests
3029
- uses: actions/upload-artifact@v4
3130
if: always()

Justfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ SOURCE_FILE := "winregistry.py"
22
TESTS_FILE := "winregistry_tests.robot"
33

44
fmt:
5-
poetry run ruff format -v {{ SOURCE_FILE }}
5+
uv run ruff format -v {{ SOURCE_FILE }}
66

77
lint:
8-
poetry run ruff check {{ SOURCE_FILE }}
8+
uv run ruff check {{ SOURCE_FILE }}
99

1010
fix:
11-
poetry run ruff check --fix --unsafe-fixes {{ SOURCE_FILE }}
11+
uv run ruff check --fix --unsafe-fixes {{ SOURCE_FILE }}
1212

1313
tests:
14-
poetry run robot {{ TESTS_FILE }}
14+
uv run robot {{ TESTS_FILE }}
1515

1616
doc:
17-
poetry run libdoc winregistry.robot _doc/winregistry.robot.html
17+
uv run libdoc winregistry.robot _doc/winregistry.robot.html

README.md

Lines changed: 17 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,7 @@
33
[![PyPI](https://img.shields.io/pypi/v/winregistry.svg)](https://pypi.python.org/pypi/winregistry)
44
[![PyPI](https://img.shields.io/pypi/dm/winregistry.svg)](https://pypi.python.org/pypi/winregistry)
55

6-
A Python library for interacting with the Windows registry
7-
8-
## Features
9-
10-
- Easy to use API for Windows registry operations
11-
- Supports creating, reading, updating, and deleting registry keys and values
12-
- Compatible with Robot Framework for automated testing
6+
A Python library for interacting with the Windows registry. This library provides a simple and intuitive API for performing common registry operations, making it easier to work with the Windows registry in Python applications and automated tests.
137

148
## Installation
159

@@ -92,75 +86,41 @@ with open_key(
9286

9387
## Usage with [Robot Testing Framework](https://robotframework.org/)
9488

89+
The library provides a Robot Framework library that makes it easy to work with the Windows registry in automated tests. The library is available as `winregistry.robot`.
90+
9591
### Documentation
9692

93+
For detailed documentation of the Robot Framework library, visit:
9794
https://shpaker.github.io/winregistry/winregistry.robot
9895

99-
### Example
100-
101-
```robotframework
102-
*** Variables ***
103-
${ SUITE_KEY_NAME } HKLM\\SOFTWARE\\_ROBOT_TESTS_
104-
${ SHORT_CASE_KEY_NAME } _CASE_KEY_
105-
${ CASE_KEY_NAME } ${ SUITE_KEY_NAME }\\${ SHORT_CASE_KEY_NAME }
106-
${ VALUE_NAME } some_testing_value
107-
108-
*** Settings ***
109-
Library Collections
110-
Library winregistry.robot
111-
Suite Setup Create Registry Key ${ SUITE_KEY_NAME }
112-
Suite Teardown Delete Registry Key ${ SUITE_KEY_NAME }
113-
114-
*** Test Cases ***
115-
TEST REGISTRY KEYS
116-
[Teardown] Delete Registry Key ${ CASE_KEY_NAME }
117-
118-
${ items } = Get Registry Key Sub Keys ${ SUITE_KEY_NAME }
119-
List Should Not Contain Value ${ items } ${ SHORT_CASE_KEY_NAME }
120-
Registry Key Should Not Exist ${ CASE_KEY_NAME }
121-
Create Registry Key ${ CASE_KEY_NAME }
122-
Registry Key Should Exist ${ CASE_KEY_NAME }
123-
${ items } = Get Registry Key Sub Keys ${ SUITE_KEY_NAME }
124-
List Should Contain Value ${ items } ${ SHORT_CASE_KEY_NAME }
125-
126-
127-
TEST REGISTRY VALUES
128-
[Setup] Create Registry Key ${ CASE_KEY_NAME }
129-
[Teardown] Delete Registry Key ${ CASE_KEY_NAME }
130-
131-
${ items } = Get Registry Key Values Names ${ CASE_KEY_NAME }
132-
List Should Not Contain Value ${ items } ${ VALUE_NAME }
133-
Registry Value Should Not Exist ${ CASE_KEY_NAME } ${ VALUE_NAME }
134-
Create Registry Value ${ CASE_KEY_NAME } ${ VALUE_NAME } SZ
135-
Registry Value Should Exist ${ CASE_KEY_NAME } ${ VALUE_NAME }
136-
${ items } = Get Registry Key Values Names ${ CASE_KEY_NAME }
137-
List Should Contain Value ${ items } ${ VALUE_NAME }
138-
${ value } = Read Registry Value ${ CASE_KEY_NAME } ${ VALUE_NAME }
139-
Should Be Equal ${ value.data } ${ EMPTY }
140-
Set Registry Value ${ CASE_KEY_NAME } ${ VALUE_NAME } Remove me!
141-
${ value } = Read Registry Value ${ CASE_KEY_NAME } ${ VALUE_NAME }
142-
Should Be Equal ${ value.data } Remove me!
143-
Delete Registry Value ${ CASE_KEY_NAME } ${ VALUE_NAME }
144-
```
96+
### Example Tests
97+
98+
A complete set of example tests demonstrating various registry operations can be found in the [winregistry_tests.robot](winregistry_tests.robot) file. These tests cover:
99+
100+
- Creating and deleting registry keys
101+
- Working with nested registry keys
102+
- Setting and reading registry values
103+
- Verifying registry key and value existence
104+
- Enumerating subkeys and values
145105

146106
## Contributing
147107

148108
Contributions are welcome! Please read our contributing guidelines for more details.
149109

150110
### Setting Up the Development Environment
151111

152-
We use `poetry` for dependency management and packaging. To set up your development environment, follow these steps:
112+
We use `uv` for dependency management and packaging. To set up your development environment, follow these steps:
153113

154-
1. Install `poetry` if you haven't already:
114+
1. Install `uv` if you haven't already:
155115

156116
```bash
157-
pip install poetry
117+
pip install uv
158118
```
159119

160120
2. Install the project dependencies:
161121

162122
```bash
163-
poetry install --sync
123+
uv sync --verbose --no-progress --locked --all-extras
164124
```
165125

166126
### Code Formatting and Linting

poetry.lock

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

0 commit comments

Comments
 (0)