Skip to content

Commit

Permalink
feat: migrate to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
achimoraites committed Apr 30, 2024
1 parent b0d69f5 commit db52946
Show file tree
Hide file tree
Showing 8 changed files with 358 additions and 77 deletions.
41 changes: 17 additions & 24 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

Expand All @@ -17,23 +10,23 @@ permissions:

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Check out repository
uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install project
run: poetry install --no-interaction
- name: Build and publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry build
poetry publish -u __token__ -p $PYPI_TOKEN
21 changes: 11 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
- name: Check out repository
uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install -r requirements.txt
python-version: "3.12"

- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install project
run: poetry install --no-interaction --with dev
- name: Run pytest
run: python -m pytest
run: poetry run pytest
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ $ pip3 install raw_image_converter
git clone https://github.com/achimoraites/Python-Image-Converter.git [my-app-name]
cd [my-app-name]

pip install -r requirements.txt
poetry install
poetry shell

python -m raw_image_converter --s <Enter-Path-Of-Directory>
```
Expand Down
295 changes: 295 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[tool.poetry]
name = "python-image-converter"
version = "1.1.3"
description = "Batch image convertions"
authors = ["Achilles Moraites <[email protected]>"]
license = "MIT"
readme = "README.md"
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
'Topic :: Utilities',
]
keywords = ["cli", "converter", "raw", "images"]
repository = "https://github.com/achimoraites/Python-Image-Converter"
packages=[{include = "raw_image_converter"}]

[tool.poetry.dependencies]
python = "^3.9"
imageio = "2.16.2"
pillow = "10.3.0"
rawpy = "0.19.1"
numpy = "1.26.4"
colorama = "0.4.6"


[tool.poetry.group.dev.dependencies]
pytest = "^8.2.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
2 changes: 1 addition & 1 deletion raw_image_converter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
"""

# Version of the package
__version__ = "1.1.2"
__version__ = "1.1.3"
5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

36 changes: 0 additions & 36 deletions setup.py

This file was deleted.

0 comments on commit db52946

Please sign in to comment.