Skip to content

Commit

Permalink
swap to poetry for build and deps
Browse files Browse the repository at this point in the history
  • Loading branch information
jpetrucciani committed Aug 27, 2024
1 parent b8402b9 commit f22fd15
Show file tree
Hide file tree
Showing 11 changed files with 58 additions and 95 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
sed -i -E "s#VERSION#${GITHUB_REF/refs\/tags\//}#g" ./setup.py
sed -i -E "s#VERSION#${GITHUB_REF/refs\/tags\//}#g" ./bucketstore.py
- env:
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
python-version: '3.11'
cache: 'poetry'
- name: build and publish
run: poetry publish --build -n -u ${{ secrets.PYPI_USER }} -p ${{ secrets.PYPI_PASSWORD }}
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
name: python ${{ matrix.python-version }} tests
steps:
- uses: actions/[email protected]
- run: pipx install poetry
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: |
pip install -r requirements.txt
pip install -r requirements.dev.txt
- run: tox -e py
cache: 'poetry'
- run: poetry install
- run: poetry run pytest ./tests -s --cov . --cov-report html --cov-report term --cov-report xml:coverage.xml --junitxml=report.xml
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ htmlcov/
.cache
nosetests.xml
coverage.xml
report.xml
*,cover
.hypothesis/

Expand Down
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![PyPI version](https://badge.fury.io/py/bucketstore.svg)](https://badge.fury.io/py/bucketstore)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![Python 3.6+ supported](https://img.shields.io/badge/python-3.6+-blue.svg)](https://www.python.org/downloads/release/python-360/)
[![Python 3.7+ supported](https://img.shields.io/badge/python-3.7+-blue.svg)](https://www.python.org/downloads/release/python-370/)

**bucketstore** is a very simple Amazon S3 client, written in Python. It
aims to be much more straight-forward to use than boto3, and specializes
Expand Down Expand Up @@ -66,7 +66,7 @@ True
{}
```

## Interact with S3 keys:
## Interact with S3 keys

```pycon
>>> bucket.key('foo')
Expand Down Expand Up @@ -127,12 +127,7 @@ Other methods include `bucketstore.login(access_key_id, secret_access_key)`, `bu
Tests are run through [Tox](https://tox.readthedocs.io/en/latest/).

```shell
# Run tests against all environments.
$ tox
# Run against a specific version.
$ tox -e py310
# Run with pytest arguments.
$ tox -- --pdb

```

✨🍰✨
2 changes: 2 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ let
nixpkgs-fmt
];
python = [
poetry
ruff
(python311.withPackages (p: with p; [
boto3

Expand Down
43 changes: 43 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
[tool.poetry]
name = "bucketstore"
version = "0.3.0"
description = "A simple library for interacting with Amazon S3."
readme = "README.md"
authors = ["jacobi petrucciani <[email protected]>"]
packages = [{ include = "bucketstore.py" }]
homepage = "https://github.com/jpetrucciani/bucketstore"
repository = "https://github.com/jpetrucciani/bucketstore"

classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"License :: OSI Approved :: MIT License",
]


[tool.poetry.dependencies]
python = ">= 3.7"
boto3 = ">= 1.20.0"

[tool.poetry.dev-dependencies]
moto = ">= 5.0.0"
ptpython = ">= 3.0.26"
pytest = "^7.4.3"
pytest-cov = "^4.1.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.black]
line-length = 100
target-version = ["py311"]

[tool.ruff]
line-length = 100
lint.select = [
Expand Down
4 changes: 0 additions & 4 deletions requirements.dev.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

11 changes: 0 additions & 11 deletions setup.cfg

This file was deleted.

45 changes: 0 additions & 45 deletions setup.py

This file was deleted.

10 changes: 0 additions & 10 deletions tox.ini

This file was deleted.

0 comments on commit f22fd15

Please sign in to comment.