Skip to content

Commit

Permalink
setuptools → hatch
Browse files Browse the repository at this point in the history
  • Loading branch information
odrling committed Jan 10, 2024
1 parent ae28b35 commit cb04791
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 20 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,26 @@ name: "Peony CI"

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
- '3.12'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install --upgrade -r tests_requirements.txt wheel
run: pip install --upgrade -e '.[tests]' build
- name: Check codestyle
run: flake8
- name: Check typing
Expand All @@ -33,4 +31,4 @@ jobs:
- name: Codecov
uses: codecov/codecov-action@v1
- name: Build package
run: python3 setup.py sdist bdist_wheel
run: python3 -m build
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ jobs:
strategy:
matrix:
python-version:
- '3.9'
- '3.12'
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install --upgrade wheel
run: pip install --upgrade build
- name: Build package
run: python3 setup.py sdist bdist_wheel
run: python3 -m build
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/twitter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
# only need to test one version, as this test tries to find out if
# Twitter's endpoints are still working as expected
python-version: '3.9'
python-version: '3.12'
- name: Install dependencies
run: pip install --upgrade -r tests_requirements.txt
- name: Run tests
Expand Down
10 changes: 1 addition & 9 deletions peony/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,12 @@
peony-twitter
===============
An asynchronous Twitter API client for Python 3.6+
An asynchronous Twitter API client for Python 3.8+
"""

__author__ = "Florian Badie"
__author_email__ = "[email protected]"
__url__ = "https://github.com/odrling/peony-twitter"

__version__ = "3.0.0"

__license__ = "MIT License"

__keywords__ = "twitter, asyncio, asynchronous"

import logging

logger = logging.getLogger(__name__)
Expand Down
64 changes: 64 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "peony-twitter"
dynamic = ["version"]
description = "An asynchronous Twitter API client for Python 3.8+"
readme = "README.rst"
license = "MIT License"
requires-python = ">=3.8"
authors = [
{ name = "odrling", email = "[email protected]" },
]
keywords = [
"asynchronous",
"asyncio",
"twitter",
]
dependencies = [
"aiohttp>=2.0,<4.0",
"async-timeout",
]

[project.optional-dependencies]
aiofiles = [
"aiofiles",
]
aiohttp = [
"aiodns",
"cchardet",
]
all = [
"aiodns",
"aiofiles",
"cchardet",
"python-magic",
"python-magic-bin; platform_system == 'Windows'",
]
magic = [
"python-magic",
"python-magic-bin; platform_system == 'Windows'",
]
media = [
"aiofiles",
"python-magic",
"python-magic-bin; platform_system == 'Windows'",
]
tests = [
"pytest",
]

[project.urls]
Homepage = "https://github.com/odrling/peony-twitter"
Repository = "https://github.com/odrling/peony-twitter.git"
Issues = "https://github.com/odrling/peony-twitter/issues"

[tool.hatch.version]
path = "peony/__init__.py"

[tool.hatch.build.targets.sdist]
include = [
"/peony",
]
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py35,py36,py37,py38,py39
envlist = py38,py39,py310,py311,py312
[testenv]
deps = -rtests_requirements.txt
commands =
Expand Down

0 comments on commit cb04791

Please sign in to comment.