Skip to content

Commit

Permalink
.github: Migrate to the pyproject.toml (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 authored Nov 5, 2024
1 parent 4bf944d commit 32e9f23
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 93 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: ammaraskar/sphinx-action@master
- name: Set up Python
uses: actions/setup-python@v5
with:
docs-folder: "docs/"
pre-build-command: "python -m pip install --upgrade pip && pip install -r requirements.txt && pip install sphinx_rtd_theme"
python-version: 3.9

- name: Install dependencies
run: pip install -e '.[docs]'

- name: Build docs
run: sphinx-build docs ./docs/_build/html/

- uses: actions/upload-artifact@v3
with:
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,17 @@ jobs:
with:
python-version: "3.x"
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
pip install build twine
- name: Build and publish
env:
TWINE_USERNAME: "__token__" # https://github.com/pypa/twine/blob/3.x/tests/test_integration.py#L53-L64
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN_CENTRALDOGMA }}
run: |
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*
22 changes: 15 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ammaraskar/sphinx-action@master
- name: Set up Python
uses: actions/setup-python@v5
with:
docs-folder: "docs/"
pre-build-command: "python -m pip install --upgrade pip && pip install -r requirements.txt && pip install sphinx_rtd_theme"
python-version: 3.9
- name: Install dependencies
run: pip install -e '.[docs]'
- name : Build docs
run: sphinx-build docs ./docs/_build/html/

linter:
name: black --check
Expand All @@ -31,7 +35,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.8", "pypy3.9"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.9", "pypy3.10"]

steps:
- uses: actions/checkout@v4
Expand All @@ -43,11 +47,13 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .
pip install -e '.[dev]'
- name: Test with pytest
run: |
Expand All @@ -65,7 +71,7 @@ jobs:
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10", "3.11","3.12", "pypy3.8", "pypy3.9"]
python-version: ["3.9", "3.10", "3.11","3.12", "3.13", "pypy3.9", "pypy3.10"]

steps:
- uses: actions/checkout@v4
Expand All @@ -74,11 +80,13 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
cache-dependency-path: "**/pyproject.toml"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -e .
pip install -e '.[dev]'
- name: Test with pytest
run: |
Expand Down
1 change: 1 addition & 0 deletions centraldogma/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.4.0"
78 changes: 78 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Copyright 2024 LINE Corporation
#
# LINE Corporation licenses this file to you under the Apache License,
# version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at:
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
[build-system]
requires = ["setuptools >= 61"]
build-backend = "setuptools.build_meta"

[project]
name = "centraldogma-python"
dynamic = ["version"]
description = "Python client library for Central Dogma"
readme = "README.md"
authors= [{name = "Central Dogma Team", email = "[email protected]"}]
license = {file = "LICENSE"}
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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",
"Topic :: Software Development :: Libraries :: Python Modules",
]
requires-python = ">=3.9"
dependencies = [
"dataclasses-json == 0.6.7",
"httpx[http2] == 0.27.2",
"marshmallow == 3.23.0",
"pydantic == 2.9.2",
"python-dateutil == 2.9.0.post0",
"tenacity == 9.0.0",
]

[project.urls]
Homepage = "https://github.com/line/centraldogma-python"
Documentation = "https://line.github.io/centraldogma-python"
Repository = "https://github.com/line/centraldogma-python.git"
Issues = "https://github.com/line/centraldogma-python/issues"

[project.optional-dependencies]
dev = [
"black",
"codecov",
"pytest",
"pytest-cov",
"pytest-mock",
"respx"
]
docs = [
"sphinx_rtd_theme"
]

[tool.setuptools]
packages = ["centraldogma", "centraldogma.data"]

[tool.setuptools.dynamic]
version = {attr = "centraldogma.__version__"}

[tool.distutils.bdist_wheel]
universal = true

[tool.pep8]
ignore = "E501"
15 changes: 0 additions & 15 deletions requirements.txt

This file was deleted.

5 changes: 0 additions & 5 deletions setup.cfg

This file was deleted.

61 changes: 0 additions & 61 deletions setup.py

This file was deleted.

0 comments on commit 32e9f23

Please sign in to comment.