Skip to content

Commit a53a8e9

Browse files
authored
chore: revert uv changes (#197)
1 parent 72732b2 commit a53a8e9

File tree

10 files changed

+1504
-1274
lines changed

10 files changed

+1504
-1274
lines changed

.github/workflows/lint.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,23 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v4
16+
- name: Set up Python 3.13
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: "3.13"
1620
- name: Install just
1721
run: |
1822
sudo apt update
1923
sudo snap install --edge --classic just
20-
- name: Install uv
21-
uses: astral-sh/setup-uv@v5
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
python -m pip install poetry
28+
poetry install
29+
2230
- name: Lint
2331
run: |
24-
just python_version="3.13" lint
32+
just lint
2533
2634
lint-commit:
2735
runs-on: ubuntu-latest

.github/workflows/publish.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This workflow will publish our package on pypi, dockerhub, and create the release notes
1+
# This workflow will publish our package on pypi
22

33
name: Publish
44

@@ -11,21 +11,18 @@ permissions:
1111
contents: write
1212

1313
jobs:
14-
publish_to_pypi:
14+
push_to_pypi:
1515
runs-on: ubuntu-latest
1616
steps:
1717
- uses: actions/checkout@v4
18-
- name: Install uv
19-
uses: astral-sh/setup-uv@v5
18+
- name: Publish python package
19+
uses: JRubics/poetry-publish@v2.1
2020
with:
21-
version: "0.6.3"
22-
- name: Publish to PyPi
23-
run: |
24-
uv build
25-
uv publish
21+
pypi_token: ${{ secrets.PYPI_TOKEN }}
22+
poetry_install_options: "--without dev"
2623

2724
push_to_docker_hub:
28-
needs: publish_to_pypi
25+
needs: push_to_pypi
2926
name: Push Docker image to Docker Hub
3027
runs-on: ubuntu-latest
3128
steps:

.github/workflows/security.yml

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,12 @@ on:
99
branches: ["main"]
1010

1111
jobs:
12-
generate-dependencies-file:
13-
runs-on: ubuntu-latest
14-
steps:
15-
- uses: actions/checkout@v4
16-
- name: Install uv
17-
uses: astral-sh/setup-uv@v5
18-
- name: Create dependencies file
19-
run: |
20-
UV_PROJECT_ENVIRONMENT=.venv uv sync
21-
UV_PROJECT_ENVIRONMENT=.venv uv pip freeze > requirements.txt
22-
- uses: actions/upload-artifact@v4
23-
with:
24-
name: requirements
25-
path: requirements.txt
26-
overwrite: true
27-
2812
osv-scanner:
29-
needs: generate-dependencies-file
3013
runs-on: ubuntu-latest
3114
container:
3215
image: ghcr.io/google/osv-scanner:v1.9.2
3316
steps:
34-
- uses: actions/download-artifact@v4
35-
with:
36-
name: requirements
17+
- uses: actions/checkout@v4
3718
- name: Run OSV Scanner
3819
run: |
3920
/osv-scanner --skip-git --format table -r .
@@ -47,16 +28,19 @@ jobs:
4728
run: |
4829
semgrep scan --config auto
4930
twyn:
50-
needs: generate-dependencies-file
5131
runs-on: ubuntu-latest
5232
steps:
5333
- uses: actions/checkout@v4
54-
- uses: actions/download-artifact@v4
34+
- name: Set up Python
35+
uses: actions/setup-python@v4
5536
with:
56-
name: requirements
57-
- name: Install uv
58-
uses: astral-sh/setup-uv@v5
37+
python-version: "3.13"
38+
- name: Install dependencies
39+
run: |
40+
python -m pip install --upgrade pip
41+
python -m pip install poetry
42+
poetry install --only main
5943
- name: Run Twyn against our dependencies
6044
run: |
61-
uv run twyn --version
62-
uv run twyn run -vv
45+
poetry run twyn --version
46+
poetry run twyn run -vv

.github/workflows/test.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,20 @@ jobs:
1919

2020
steps:
2121
- uses: actions/checkout@v4
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ matrix.python-version }}
2226
- name: Install just
2327
run: |
2428
sudo apt update
2529
sudo snap install --edge --classic just
26-
- name: Install uv
27-
uses: astral-sh/setup-uv@v5
30+
- name: Install dependencies
31+
run: |
32+
python -m pip install --upgrade pip
33+
python -m pip install poetry
34+
poetry install
35+
2836
- name: Test with pytest
2937
run: |
30-
just python_version=${{ matrix.python-version }} test
38+
just test

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ For new feature proposals, please create first an issue to start a discussion ab
1010

1111
git clone git@github.com:<username>/twyn.git
1212
cd twyn/
13-
3. Make sure to have [uv](https://docs.astral.sh/uv/getting-started/installation/) installed in your system, as well as [just](https://github.com/casey/just).
13+
3. Make sure to have [poetry](https://python-poetry.org/) installed in your system, as well as [just](https://github.com/casey/just).
1414
4. Set up your working environment: create a virtual environment and install the project dependencies.
1515
The following command will do both:
1616

justfile

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# VARIABLE DEFINITIONS
22
venv := ".venv"
3-
python_version :="3.13"
3+
bin := venv + "/bin"
4+
python := bin + "/python"
5+
python_version := "python3.13"
46
target_dirs := "src tests"
57

8+
9+
# SENTINELS
10+
venv-exists := path_exists(venv)
11+
612
# ALIASES
713
alias t := test
814

@@ -13,35 +19,32 @@ alias t := test
1319
help:
1420
just --list --unsorted
1521

16-
# Cleans all artifacts generated while running this project, including the virtualenv.
17-
venv:
18-
@UV_PROJECT_ENVIRONMENT={{ venv }} UV_PYTHON={{ python_version }} uv sync
22+
# Generate the virtual environment.
23+
venv:
24+
@if ! {{ venv-exists }}; \
25+
then \
26+
POETRY_VIRTUALENVS_IN_PROJECT=1 poetry env use {{ python_version }}; \
27+
poetry install; \
28+
fi
1929

2030
# Cleans all artifacts generated while running this project, including the virtualenv.
2131
clean:
2232
@rm -f .coverage*
2333
@rm -rf {{ venv }}
2434

2535
# Runs the tests with the specified arguments (any path or pytest argument).
26-
test *test-args='':
27-
@UV_PROJECT_ENVIRONMENT={{ venv }} UV_PYTHON={{ python_version }} uv run pytest {{ test-args }} --no-cov
36+
test *test-args='': venv
37+
poetry run pytest {{ test-args }} --no-cov
2838

2939
# Runs all tests including coverage report.
30-
test-all:
31-
@UV_PROJECT_ENVIRONMENT={{ venv }} UV_PYTHON={{ python_version }} uv run pytest
40+
test-all: venv
41+
poetry run pytest
3242

3343
# Format all code in the project.
34-
format:
35-
@UV_PROJECT_ENVIRONMENT={{ venv }} UV_PYTHON={{ python_version }} uv run ruff check {{ target_dirs }} --fix
44+
format: venv
45+
poetry run ruff check {{ target_dirs }} --fix
3646

3747
# Lint all code in the project.
38-
lint:
39-
@UV_PROJECT_ENVIRONMENT={{ venv }} UV_PYTHON={{ python_version }} uv run ruff check {{ target_dirs }}
40-
@UV_PROJECT_ENVIRONMENT={{ venv }} UV_PYTHON={{ python_version }} uv run mypy {{ target_dirs }}
41-
42-
43-
# Generate requirements.txt file
44-
dependencies:
45-
@UV_PROJECT_ENVIRONMENT={{ venv }} UV_PYTHON={{ python_version }} uv sync
46-
@UV_PROJECT_ENVIRONMENT={{ venv }} UV_PYTHON={{ python_version }} uv pip freeze > requirements.txt
47-
48+
lint: venv
49+
poetry run ruff check {{ target_dirs }}
50+
poetry run mypy {{ target_dirs }}

0 commit comments

Comments
 (0)