Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ refactor: move to uv #58

Merged
merged 8 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/lint-and-fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@ jobs:
run: |
npm install -g prettier

- name: Install poetry
run: pipx install poetry
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Install python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
cache: 'poetry'

- name: Install just
uses: extractions/setup-just@v2
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Install python
uses: actions/setup-python@v5
with:
python-version: '3.x'
cache: 'poetry'

- name: Install just
uses: extractions/setup-just@v2
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh

- name: Install python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
cache: 'poetry'

- name: Install just
uses: extractions/setup-just@v2
Expand Down
17 changes: 0 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,25 +117,8 @@ dmypy.json
# macOS
.DS_Store

# Media files
*.aac
*.mp3
*.mp4
*.m4s
*.xml
*.pb
*.ass
*.srt
*.nfo

# test files
*.test.py

# stub files
py.typed

# logs
log

# test files
__test_files__
33 changes: 16 additions & 17 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,37 @@
VERSION := `poetry run python -c "import sys; from moelib import __version__ as version; sys.stdout.write(version)"`
VERSION := `uv run python -c "import sys; from moelib import __version__ as version; sys.stdout.write(version)"`

install:
poetry install
uv sync --all-extras --dev

test:
poetry run pytest
uv run pytest
just clean

fmt:
poetry run ruff format .
uv run ruff format .

lint:
poetry run pyright moelib tests
poetry run ruff check .
uv run pyright src/moelib tests
uv run ruff check .

fmt-docs:
prettier --write '**/*.md'

build:
touch moelib/py.typed
poetry build
uv tool run --from build python -m build --installer uv .

release:
@echo 'Tagging v{{VERSION}}...'
git tag "v{{VERSION}}"
@echo 'Push to GitHub to trigger publish process...'
git push --tags

publish:
touch moelib/py.typed
poetry publish --build
git tag "v{{VERSION}}"
git push --tags
just clean-builds
# Missing command for uv
# publish:
# poetry publish --build
# git tag "v{{VERSION}}"
# git push --tags
# just clean-builds

clean:
find . -name "*.pyc" -print0 | xargs -0 rm -f
Expand All @@ -46,15 +45,15 @@ clean-builds:
rm -rf *.egg-info/

ci-install:
poetry install --no-interaction --no-root
just install

ci-fmt-check:
poetry run ruff format --check --diff .
uv run ruff format --check --diff .
prettier --check '**/*.md'

ci-lint:
just lint

ci-test:
poetry run pytest --reruns 3 --reruns-delay 1
uv run pytest --reruns 3 --reruns-delay 1
just clean
191 changes: 0 additions & 191 deletions poetry.lock

This file was deleted.

3 changes: 0 additions & 3 deletions poetry.toml

This file was deleted.

Loading