Skip to content
This repository was archived by the owner on Oct 29, 2023. It is now read-only.

Preparing migration to Poetry #124

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
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
21 changes: 6 additions & 15 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,11 @@ on:
- '*'

jobs:
deploy:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: actions/checkout@v3
- name: Build and publish to pypi
uses: JRubics/[email protected]
with:
pypi_token: ${{ secrets.PYPI_TOKEN }}
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ RUN apt-get update \
&& apt-get -y install sudo python3-pip \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip;\
pip install pipenv;\
PIP_IGNORE_INSTALLED=1 pipenv install --system --deploy;\
pip install poetry;\
PIP_IGNORE_INSTALLED=1 poetry install;\
Comment on lines 13 to +15
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markusressel I haven't used the Dockerfile yet. Is it from your perspective simple as that replacing pipenv with poetry in the Dockerfile?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@markusressel markusressel Mar 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The referenced Dockerfile uses Alpine as a base, which has its downsides, see: https://pythonspeed.com/articles/alpine-docker-python/

For a version based on buster, have a look at this one:
https://github.com/markusressel/openhasp-config-manager/blob/main/Dockerfile

The mentioned file is also used for a CLI tool, so it should be more fitting to python-n26 than the one from alerticular.

pip install .

ENTRYPOINT [ "n26" ]
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ build:
- git stash pop

test:
pipenv run pytest
poetry run pytest

upload:
# Upload to PyPI: https://pypi.org/project/n26/
Expand Down
23 changes: 0 additions & 23 deletions Pipfile

This file was deleted.

511 changes: 0 additions & 511 deletions Pipfile.lock

This file was deleted.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,14 @@ If there are any issues, bugs or missing API endpoints, feel free to contribute

### Run locally

Prerequirements: [Pipenv](https://pipenv.readthedocs.io/)
Prerequirements: [Poetry](https://python-poetry.org/) and

```shell
git clone [email protected]:femueller/python-n26.git
cd python-n26
pipenv shell
pipenv install
python3 -m n26 balance
poetry shell
poetry install
python -m n26 balance
```

### Creating a new release (only for maintainers)
Expand Down
709 changes: 709 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[tool.poetry]
name = "n26"
version = "3.3.0"
description = "Unofficial Python client for n26 (Number 26)"
authors = ["femueller", "markusressel"]

[tool.poetry.dependencies]
python = "==3.11"
click = "*"
container-app-conf = "==5.*,>=5.2.0"
inflect = "*"
pycryptodome = ">=3.9"
pyyaml = "*"
requests = "==2.*,>=2.28.0"
tabulate = ">=0.9.0"
tenacity = "==8.*,>=8.1.0"
urllib3 = "==1.*,>=1.26.0"

[tool.poetry.dev-dependencies]
flake8 = "*"
mock = "*"
pytest = "*"