Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating project to prepare for deployment to PyPi #4

Merged
merged 4 commits into from
Dec 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,31 @@ jobs:
body-path: comment_body.md
comment-id: ${{ steps.find-comment.outputs.comment-id }}
edit-mode: replace
pytest-additional-versions:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install the project
run: uv sync --all-extras --dev
- name: Run tests
run: uv run pytest tests
25 changes: 25 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Release

on:
push:
tags:
# Publish on any tag that looks like a semantic version e.g. 1.2.3
- '*.*.*'

jobs:
pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
environment:
name: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
- run: uv build
- name: Smoke test (wheel)
run: uv run --isolated --no-project -p 3.9 --with dist/*.whl tests/smoke_test.py
- name: Smoke test (source distribution)
run: uv run --isolated --no-project -p 3.9 --with dist/*.tar.gz tests/smoke_test.py
- run: uv publish --trusted-publishing always
27 changes: 27 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,34 @@ authors = [
{ name = "Owen Lamont", email = "[email protected]" }
]
requires-python = ">=3.9"
keywords = [
"uv", "uv.lock", "vulnerabilities"
]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python",
"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 :: 3 :: Only",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Testing",
"Topic :: Software Development :: Libraries",
]

dependencies = [
"httpx>=0.28.1",
"inflect>=7.4.0",
"pydantic>=2.10.3",
"rich>=13.9.4",
'tomli; python_version < "3.11"',
"typer>=0.15.1",
]

Expand All @@ -31,6 +54,10 @@ jupyter = [
[project.scripts]
uv-secure = "uv_secure.run:app"

[project.urls]
Repository = "https://github.com/owenlamont/uv-secure"
Releases = "https://github.com/owenlamont/uv-secure/releases"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
Expand Down
3 changes: 2 additions & 1 deletion src/uv_secure/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from uv_secure.__version__ import __version__
from uv_secure.run import app, check_dependencies


__all__ = ["app", "check_dependencies"]
__all__ = ["__version__", "app", "check_dependencies"]
10 changes: 10 additions & 0 deletions tests/smoke_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Check that basic features work.

Catch cases where e.g. files are missing so the import doesn't work. It is
recommended to check that e.g. assets are included.
"""

import uv_secure


print(uv_secure.__version__)
8 changes: 5 additions & 3 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading