Skip to content

Commit

Permalink
fix: migrate to pyproject
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Dec 29, 2024
1 parent fc3f5ef commit 7fcf67a
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 64 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# These are supported funding model platforms

custom: 'https://www.kitware.com/contact-us/'
custom: 'https://www.kitware.com/trame/'
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
29 changes: 18 additions & 11 deletions .github/workflows/test_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-python@v2
- uses: actions/setup-python@v5
with:
python-version: "3.9"

Expand All @@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.9]
python-version: ["3.9"]
config:
- {
name: "Linux",
Expand All @@ -49,16 +49,16 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install and Run Tests
run: |
pip install .
pip install ".[dev]"
pip install -r tests/requirements.txt
# Run the tests with coverage so we get a coverage report too
pip install coverage
Expand All @@ -73,7 +73,7 @@ jobs:
runs-on: ubuntu-latest
name: Check and Lint
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0 # needed so commitlint can lint the commits

Expand All @@ -96,16 +96,23 @@ jobs:
needs: [pre-commit, pytest, check-and-lint]
runs-on: ubuntu-latest
if: github.event_name == 'push'
environment: release
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
contents: write # IMPORTANT: mandatory for making GitHub Releases

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Python Semantic Release
uses: relekang/python-semantic-release@v7.34.6
id: release
uses: python-semantic-release/python-semantic-release@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
repository_username: __token__
repository_password: ${{ secrets.PYPI_API_TOKEN }}

- name: Publish package distributions to PyPI
if: steps.release.outputs.released == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
4 changes: 2 additions & 2 deletions .github/workflows/website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 18
- name: Setup Pages
Expand Down
93 changes: 93 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
[project]
name = "trame"
version = "3.7.1"
description = "Trame, a framework to build applications in plain Python"
authors = [
{name = "Kitware Inc."},
]
dependencies = [
"trame-server>=3.2.3,<4",
"trame-client>=3.4,<4",
"wslink>=2.1.3",
]
requires-python = ">=3.9"
readme = "README.rst"
license = {text = "Apache License 2.0"}
keywords = ["Python", "Interactive", "Web", "Application", "Framework"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"License :: OSI Approved :: Apache License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Topic :: Software Development :: Libraries :: Python Modules",
]

[project.optional-dependencies]
app = [
"pywebview",
]
jupyter = [
"jupyterlab",
]
dev = [
"pre-commit",
"ruff",
"pytest",
]

[build-system]
requires = ['setuptools', 'wheel']
build-backend = 'setuptools.build_meta'

[tool.setuptools.packages.find]
where = ["."]

[tool.setuptools.package-data]


[tool.semantic_release]
version_toml = [
"pyproject.toml:project.version",
]
build_command = """
python -m venv .venv
source .venv/bin/activate
pip install -U pip build
python -m build .
"""

[semantic_release.publish]
dist_glob_patterns = ["dist/*"]
upload_to_vcs_release = true

[tool.ruff]
line-length = 88
indent-width = 4
target-version = "py39"

[tool.ruff.lint]
select = ["E", "W", "F"]
ignore = []
fixable = ["ALL"]
unfixable = []


[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
docstring-code-format = true

# This only has an effect when the `docstring-code-format` setting is
# enabled.
docstring-code-line-length = "dynamic"

[tool.ruff.lint.pycodestyle]
max-line-length = 120

[lint.pydocstyle]
convention = "google"
11 changes: 0 additions & 11 deletions ruff.toml

This file was deleted.

35 changes: 0 additions & 35 deletions setup.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

0 comments on commit 7fcf67a

Please sign in to comment.