Skip to content

Commit 61806e9

Browse files
authored
Merge pull request #10 from chmouel/uv
migrate to uv instead of poetry
2 parents b68a26a + 077c28a commit 61806e9

File tree

11 files changed

+106
-206
lines changed

11 files changed

+106
-206
lines changed

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ PACKAGE_NAME := nextmeeting
33
all: lint run
44

55
run:
6-
@poetry run $(PACKAGE_NAME)
6+
@uv run $(PACKAGE_NAME)
77

88
release:
99
@./packaging/make-release.sh
1010

1111
lint:
12-
@poetry run ruff $(PACKAGE_NAME)
12+
@uv run ruff check src/$(PACKAGE_NAME)
1313

1414

1515
.PHONY: lint release run all

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ Use `pip` with:
2525

2626
`pip install -U nextmeeting`
2727

28-
or Checkout the source of this repo and use `poetry` :
28+
or Checkout the source of this repo by [using uv](https://docs.astral.sh/uv/getting-started/installation/):
2929

30-
`poetry run nextmeeting`
30+
`uv run nextmeeting`
3131

32-
If you don't want to use poetry you can install the depndences packages from PyPi
32+
If you don't want to use `uv` you can install the dependences packages from PyPi
3333
or from your operating system package manager if available:
3434

3535
- <https://pypi.org/project/python-dateutil/>

packaging/aur/PKGBUILD

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ arch=('any')
99
url="https://github.com/chmouel/nextmeeting"
1010
license=('Apache')
1111
depends=('python-dateutil' 'gcalcli')
12-
makedepends=('python-build' 'python-installer' 'python-setuptools' 'python-wheel' 'python-poetry-core')
1312
source=("https://github.com/chmouel/${pkgname}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.gz")
1413
sha256sums=('edfd9aa245aba16bca2f4d219343e55d7d331f5a7bc3cee2874e14dc15951b63')
14+
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-hatchling')
1515

1616
build() {
17-
cd "$pkgname-$pkgver" || exit
18-
rm -vf LICENSE
19-
python -m build --wheel --no-isolation
17+
cd "$pkgname-$pkgver" || exit
18+
rm -vf LICENSE
19+
python -m build --wheel --no-isolation
2020
}
2121

2222
package() {
23-
cd "${pkgname}-${pkgver}" || exit
24-
python -m installer --destdir="$pkgdir" dist/*.whl
23+
cd "${pkgname}-${pkgver}" || exit
24+
python -m installer --destdir="$pkgdir" dist/*.whl
2525
}

packaging/aur/build.sh

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
set -euo pipefail
33
IFS=$'\n\t'
44

5-
POETRY_NAME_VERSION="$(poetry version)"
6-
PKGNAME=${POETRY_NAME_VERSION% *}
5+
PKGNAME=$(sed -n '/^name = / { s/name = "\(.*\)"/\1/ ;p;}' pyproject.toml)
6+
PKGVERSION=$(sed -n '/^version = / { s/version = "\(.*\)"/\1/ ;p;}' pyproject.toml)
77
AUTHOR_EMAIL="$(git config --get user.email)"
88
AUTHOR_NAME="$(git config --get user.name)"
99
RELEASE=1
@@ -13,29 +13,29 @@ gitdir=$(git rev-parse --show-toplevel)
1313
cd "${gitdir}"
1414

1515
while getopts "d" o; do
16-
case "${o}" in
17-
d)
18-
finalaction="echo done"
19-
;;
20-
*)
21-
echo "Invalid option"
22-
exit 1
23-
;;
24-
esac
16+
case "${o}" in
17+
d)
18+
finalaction="echo done"
19+
;;
20+
*)
21+
echo "Invalid option"
22+
exit 1
23+
;;
24+
esac
2525
done
2626
shift $((OPTIND - 1))
2727

28-
VERSION=${1:-${POETRY_NAME_VERSION#* }}
28+
VERSION=${1:-${PKGVERSION}}
2929

3030
sudo docker build -f ./packaging/aur/Dockerfile -t ${image_name} .
3131

3232
sudo docker run --rm \
33-
-v ~/.config/copr:/home/builder/.config/copr \
34-
-v "${gitdir}":/src \
35-
-v $SSH_AUTH_SOCK:/ssh-agent --env SSH_AUTH_SOCK=/ssh-agent \
36-
--name ${PKGNAME}-builder \
37-
-it ${image_name} \
38-
/bin/bash -c "set -x;mkdir -p ~/.ssh/;chmod 0700 ~/.ssh && \
33+
-v ~/.config/copr:/home/builder/.config/copr \
34+
-v "${gitdir}":/src \
35+
-v $SSH_AUTH_SOCK:/ssh-agent --env SSH_AUTH_SOCK=/ssh-agent \
36+
--name ${PKGNAME}-builder \
37+
-it ${image_name} \
38+
/bin/bash -c "set -x;mkdir -p ~/.ssh/;chmod 0700 ~/.ssh && \
3939
ssh-keyscan aur.archlinux.org >> ~/.ssh/known_hosts && \
4040
git clone --depth=1 ssh://aur@aur.archlinux.org/${PKGNAME} /tmp/${PKGNAME} && \
4141
cd /tmp/${PKGNAME} && \

packaging/make-release.sh

Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,44 @@
11
#!/usr/bin/env bash
22
set -euf
33
VERSION=${1-""}
4-
POETRY_NAME_VERSION="$(poetry version)"
5-
PKGNAME=${POETRY_NAME_VERSION% *}
4+
PKGNAME=$(sed -n '/^name = / { s/name = "\(.*\)"/\1/ ;p;}' pyproject.toml)
65

76
docker ps -q >/dev/null || exit 1
87

98
bumpversion() {
10-
current=$(git describe --tags $(git rev-list --tags --max-count=1))
11-
echo "Current version is ${current}"
9+
current=$(git describe --tags $(git rev-list --tags --max-count=1))
10+
echo "Current version is ${current}"
1211

13-
major=$(python3 -c "import semver,sys;print(str(semver.VersionInfo.parse(sys.argv[1]).bump_major()))" ${current})
14-
minor=$(python3 -c "import semver,sys;print(str(semver.VersionInfo.parse(sys.argv[1]).bump_minor()))" ${current})
15-
patch=$(python3 -c "import semver,sys;print(str(semver.VersionInfo.parse(sys.argv[1]).bump_patch()))" ${current})
12+
major=$(python3 -c "import semver,sys;print(str(semver.VersionInfo.parse(sys.argv[1]).bump_major()))" ${current})
13+
minor=$(python3 -c "import semver,sys;print(str(semver.VersionInfo.parse(sys.argv[1]).bump_minor()))" ${current})
14+
patch=$(python3 -c "import semver,sys;print(str(semver.VersionInfo.parse(sys.argv[1]).bump_patch()))" ${current})
1615

17-
echo "If we bump we get, Major: ${major} Minor: ${minor} Patch: ${patch}"
18-
read -p "To which version you would like to bump [M]ajor, Mi[n]or, [P]atch or Manua[l]: " ANSWER
19-
if [[ ${ANSWER,,} == "m" ]];then
20-
mode="major"
21-
elif [[ ${ANSWER,,} == "n" ]];then
22-
mode="minor"
23-
elif [[ ${ANSWER,,} == "p" ]];then
24-
mode="patch"
25-
elif [[ ${ANSWER,,} == "l" ]];then
26-
read -p "Enter version: " -e VERSION
27-
return
28-
else
29-
print "no or bad reply??"
30-
exit
31-
fi
32-
VERSION=$(python3 -c "import semver,sys;print(str(semver.VersionInfo.parse(sys.argv[1]).bump_${mode}()))" ${current})
33-
[[ -z ${VERSION} ]] && {
34-
echo "could not bump version automatically"
35-
exit
36-
}
37-
echo "Releasing ${VERSION}"
16+
echo "If we bump we get, Major: ${major} Minor: ${minor} Patch: ${patch}"
17+
read -p "To which version you would like to bump [M]ajor, Mi[n]or, [P]atch or Manua[l]: " ANSWER
18+
if [[ ${ANSWER,,} == "m" ]]; then
19+
mode="major"
20+
elif [[ ${ANSWER,,} == "n" ]]; then
21+
mode="minor"
22+
elif [[ ${ANSWER,,} == "p" ]]; then
23+
mode="patch"
24+
elif [[ ${ANSWER,,} == "l" ]]; then
25+
read -p "Enter version: " -e VERSION
26+
return
27+
else
28+
print "no or bad reply??"
29+
exit
30+
fi
31+
VERSION=$(python3 -c "import semver,sys;print(str(semver.VersionInfo.parse(sys.argv[1]).bump_${mode}()))" ${current})
32+
[[ -z ${VERSION} ]] && {
33+
echo "could not bump version automatically"
34+
exit
35+
}
36+
echo "Releasing ${VERSION}"
3837
}
3938

4039
[[ $(git rev-parse --abbrev-ref HEAD) != main ]] && {
41-
echo "you need to be on the main branch"
42-
exit 1
40+
echo "you need to be on the main branch"
41+
exit 1
4342
}
4443
[[ -z ${VERSION} ]] && bumpversion
4544

@@ -49,8 +48,10 @@ git commit -S -m "Release ${VERSION} 🥳" ${vfile} || true
4948
git tag -s ${VERSION} -m "Releasing version ${VERSION}"
5049
git push --tags origin ${VERSION}
5150
git push origin main
52-
poetry build -f sdist
51+
rm -rf dist/
52+
mkdir dist
53+
uv build
5354
gh release create ${VERSION} ./dist/${PKGNAME}-${VERSION}.tar.gz
54-
poetry publish -u __token__ -p $(pass show pypi/token)
55+
uv publish -u __token__ -p $(pass show pypi/token)
5556

5657
./packaging/aur/build.sh

poetry.lock

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

pyproject.toml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,22 @@
1-
[tool.poetry]
1+
[project]
22
name = "nextmeeting"
33
version = "1.5.3"
44
description = "Show your nextmeeting in your poly/waybar with gcalcli"
5-
authors = ["Chmouel Boudjnah <chmouel@chmouel.com>"]
6-
keywords = ["calendar", "cli"]
75
readme = "README.md"
6+
authors = [{ name = "Chmouel Boudjnah", email = "chmouel@chmouel.com" }]
7+
requires-python = ">=3.9"
88
license = "Apache-2.0"
9-
homepage = "https://github.com/chmouel/nextmeeting"
10-
repository = "https://github.com/chmouel/nextmeeting"
11-
include = ["LICENSE"]
9+
dependencies = ["python-dateutil>=2.9.0.post0"]
1210
classifiers = ["License :: OSI Approved :: Apache Software License"]
11+
keywords = ["calendar", "cli"]
1312

14-
[tool.poetry.dependencies]
15-
python = "^3.9"
16-
python-dateutil = "^2.8.2"
17-
18-
[tool.poetry.scripts]
13+
[project.scripts]
1914
nextmeeting = "nextmeeting.cli:main"
2015

21-
[tool.poetry.group.dev.dependencies]
22-
ruff = "^0.0.291"
23-
mypy = "^0.920"
16+
[build-system]
17+
requires = ["hatchling"]
18+
build-backend = "hatchling.build"
2419

2520
[tool.ruff.lint]
2621
ignore = ["E501", "PLR0912"]
2722
select = ["E", "F", "D4", "PT", "PL"]
28-
29-
[build-system]
30-
requires = ["poetry-core>=1.0.0"]
31-
build-backend = "poetry.core.masonry.api"
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)