-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from rveachkc/rveach/uv-and-actions
uv, ruff, github actions
- Loading branch information
Showing
14 changed files
with
701 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
name: Python package | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
|
||
- name: Set up Python | ||
run: uv python install | ||
|
||
- name: Install the project | ||
run: uv sync --all-extras --dev | ||
|
||
- name: Run tests | ||
env: | ||
MS_TEAMS_WEBHOOK: https://httpbin.org/ | ||
run: uv run pytest tests --junit-xml=test-results.xml | ||
|
||
- name: Upload test results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pytest-results | ||
path: test-results.xml | ||
|
||
- name: Run Ruff | ||
run: uv run ruff check . --output-file ruff-results.xml --output-format junit | ||
|
||
- name: Upload ruff results | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ruff-results | ||
path: ruff-results.xml | ||
|
||
build: | ||
|
||
name: build distribution | ||
runs-on: ubuntu-latest | ||
|
||
needs: | ||
- test | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- run: git fetch --tags | ||
|
||
- name: Install uv | ||
uses: astral-sh/setup-uv@v3 | ||
|
||
- name: Build dist | ||
run: uv build | ||
|
||
- name: built artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
publish-to-pypi: | ||
name: >- | ||
Publish Python 🐍 distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/pymsteams | ||
permissions: | ||
id-token: write | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
repos: | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.8.6 # Use the latest stable release | ||
hooks: | ||
- id: ruff # run the linter | ||
args: [ --fix ] | ||
stages: [pre-commit] # Only run on staged files | ||
- id: ruff-format # run the formmatter | ||
stages: [pre-commit] # Only run on staged files | ||
|
||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 # Use the latest stable release | ||
hooks: | ||
- id: check-ast | ||
- id: check-yaml | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
[build-system] | ||
requires = ["setuptools>=64", "setuptools-scm>=8"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "pymsteams" | ||
dynamic = ["version"] | ||
description="Format messages and post to Microsoft Teams." | ||
readme = "README.md" | ||
requires-python = ">=3.9" | ||
dependencies = [ | ||
"requests>=2.20.0", | ||
] | ||
license = {file = "LICENSE"} | ||
keywords=['Microsoft', 'Teams'] | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Information Technology", | ||
"Intended Audience :: System Administrators", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Topic :: Internet", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Office/Business", | ||
"Topic :: Office/Business :: Groupware", | ||
] | ||
|
||
[project.optional-dependencies] | ||
async = [ | ||
"httpx>=0.28.1", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/rveachkc/pymsteams" | ||
|
||
|
||
[tool.pytest.ini_options] | ||
pythonpath = [ | ||
"src/" | ||
] | ||
addopts = "-ra -q" | ||
testpaths = [ | ||
"tests", | ||
] | ||
|
||
[tool.uv] | ||
dev-dependencies = [ | ||
"pytest-cov>=6.0.0", | ||
"pytest>=8.3.4", | ||
"ruff>=0.8.6", | ||
] | ||
|
||
[tool.setuptools_scm] | ||
local_scheme = "no-local-version" |
Oops, something went wrong.