-
Notifications
You must be signed in to change notification settings - Fork 89
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
Future code base components? (python 3.12 / pyproject.toml vs setup.py / poetry vs pip-pipenv-twine-... / docker improvements) #181
base: master
Are you sure you want to change the base?
Changes from all commits
e1530dd
9c5ac51
0e920f4
63920bb
09edea9
131195d
69cff35
c166add
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,31 +10,27 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@master | ||
- name: Checkout code 🛒 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Update version file ⬆️ | ||
uses: brettdorrans/[email protected] | ||
with: | ||
filename: '.VERSION' | ||
placeholder: '${VERSION}' | ||
|
||
- name: Set up Python 3.12 | ||
- name: Set up Python 3.12 🐍 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Install pypa/build | ||
run: >- | ||
python -m | ||
pip install | ||
build | ||
--user | ||
|
||
- name: Build a source tarball | ||
run: >- | ||
python -m | ||
build | ||
--sdist | ||
--outdir dist/ . | ||
- name: Install and configure Poetry 📜 | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: false | ||
|
||
- name: Build & Package project 👷 | ||
run: poetry build | ||
|
||
- name: Publish distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need |
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
FROM python:3.12-alpine | ||
|
||
# Install python-lxml | ||
RUN apk add --no-cache --virtual .build-deps \ | ||
gcc musl-dev \ | ||
libxslt-dev libxml2-dev && \ | ||
pip install lxml setuptools && \ | ||
apk del .build-deps && \ | ||
apk add --no-cache libxslt libxml2 | ||
RUN adduser -D withings-sync | ||
|
||
RUN mkdir -p /src | ||
COPY . /src | ||
USER withings-sync | ||
WORKDIR /home/withings-sync | ||
|
||
RUN cd /src && \ | ||
pip install . | ||
ENV PATH="/home/withings-sync/.poetry/bin:${PATH}" \ | ||
PATH="/home/withings-sync/.local/bin:${PATH}" \ | ||
PIP_ROOT_USER_ACTION=ignore \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=on \ | ||
POETRY_HOME=/home/withings-sync/.poetry \ | ||
POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=1 \ | ||
POETRY_VIRTUALENVS_CREATE=1 \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache | ||
|
||
ENTRYPOINT ["withings-sync"] | ||
RUN pip install poetry | ||
|
||
COPY --chown=withings-sync:withings-sync pyproject.toml poetry.lock README.md .VERSION ./ | ||
RUN poetry install --without dev --no-root && rm -rf $POETRY_CACHE_DIR | ||
|
||
COPY --chown=withings-sync:withings-sync withings_sync ./withings_sync/ | ||
RUN poetry install --without dev | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. without a deeper understanding of poetry, can we compbine lines 20 -24 into two lines (copy all the required files and then install it)? |
||
|
||
ENTRYPOINT ["poetry", "run", "withings-sync"] |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file was not used anymore. We used release in GitHub actions with the help of the .VERSION file. |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[tool.poetry] | ||
name = "withings-sync" | ||
version = "5.0.0a1" | ||
description = "A tool for synchronisation of Withings (ex. Nokia Health Body) to Garmin Connect and Trainer Road." | ||
authors = ["Steffen Vogel <[email protected]>", | ||
"Masayuki Hamasaki", | ||
] | ||
license = "MIT" | ||
readme = "README.md" | ||
packages = [{include = "withings_sync"}] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.12" | ||
garth = "^0.4.46" | ||
requests = "^2.32.3" | ||
lxml = "^5.3.0" | ||
python-dotenv = "^1.0.1" | ||
importlib-resources = "^6.4.5" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
black = "^24.10.0" | ||
pylint = "^3.3.1" | ||
|
||
[tool.poetry.scripts] | ||
withings-sync = "withings_sync.sync:main" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we can use the git tag as a source of version, we can get rid of this step and the .VERSION file.