Skip to content

Commit

Permalink
chore(ci): setup ci
Browse files Browse the repository at this point in the history
  • Loading branch information
jeertmans committed Jun 18, 2024
1 parent 42edbb8 commit 694565b
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 16 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Upload Packages

on:
push:

release:
types: [published]

jobs:
publish-python:
name: Publish Python package
runs-on: ubuntu-latest
environment: release
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Rye
env:
RYE_INSTALL_OPTION: --yes
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
- name: Configure Rye
run: rye config --set-bool behavior.use-uv=true

- name: Build package
run: rye build

- name: Publish to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and follows the Sionna versioning:
`(sionna_major, sionna_minor, sionna_patch, fix)`.

The three first parts indicate the official supported version of
Sionna, and `fix` is used to indicate patch version
for our library.

<!-- start changelog -->

(unreleased)=
## [Unreleased](https://github.com/jeertmans/sionna-vispy/compare/v0.18.0...HEAD)

(v0.18.0)=
## [v0.18.0](https://github.com/jeertmans/sionna-vispy/commits/v0.18.0)

(v0.18.0-added)=
### Added

- Created first package.
[#1](https://github.com/jeertmans/sionna-vispy/pull/1)

<!-- end changelog -->
82 changes: 71 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
requires = ["hatchling", "hatch-fancy-pypi-readme"]

[project]
authors = [
Expand All @@ -22,12 +22,79 @@ recommended = [
"pyside6>=6.0.0",
]

[tool.bumpversion]
allow_dirty = false
commit = true
commit_args = ""
current_version = "0.18.0"
ignore_missing_version = false
message = "chore(deps): bump version from {current_version} to {new_version}"
parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<fix>\d+))?'
regex = false
replace = "{new_version}"
search = "{current_version}"
serialize = ["{major}.{minor}.{patch}.{fix}", "{major}.{minor}.{patch}"]
sign_tags = false
tag = false
tag_message = "chore(version): {current_version} → {new_version}"
tag_name = "v{new_version}"

[[tool.bumpversion.files]]
filename = "src/sionna_vispy/__version__.py"
replace = '__version__ = "{new_version}"'
search = '__version__ = "{current_version}"'

[[tool.bumpversion.files]]
filename = "CHANGELOG.md"
replace = "v{new_version}"
search = "Unreleased"

[[tool.bumpversion.files]]
filename = "CHANGELOG.md"
replace = "v{new_version}"
search = "unreleased"

[[tool.bumpversion.files]]
filename = "CHANGELOG.md"
replace = "v{current_version}...v{new_version}"
search = "v{current_version}...HEAD"

[[tool.bumpversion.files]]
filename = "CHANGELOG.md"
replace = '''<!-- start changelog -->
(unreleased)=
## [Unreleased](https://github.com/jeertmans/sionna-vispy/compare/{new_version}...HEAD)'''
search = "<!-- start changelog -->"

[tool.hatch.build.targets.wheel]
packages = ["src/sionna_vispy"]

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.metadata.hooks.fancy-pypi-readme]
content-type = "text/markdown"

[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
text = """<p align="center">
<a href="https://www.github.com/jeertmans/manin-slides">
<img src="https://raw.githubusercontent.com/jeertmans/manim-slides/main/static/logo.png"/>
</a>
</p>
"""

[[tool.hatch.metadata.hooks.fancy-pypi-readme.fragments]]
path = "README.md"
start-after = "<!-- start pypi -->"

[[tool.hatch.metadata.hooks.fancy-pypi-readme.substitutions]]
pattern = '> \[!([A-Z]+)\]'
replacement = '> **\1:**'

[tool.hatch.version]
path = "src/sionna_vispy/__version__.py"

[tool.pyright]
include = ["src/sionna_vispy"]
venv = ".venv"
Expand All @@ -37,22 +104,15 @@ venvPath = "."
docstring-code-format = true

[tool.ruff.lint]
extend-ignore = [
]
extend-select = ["B", "C90", "I", "N", "RUF", "UP", "T"]
isort = {known-first-party = ["sionna_vispy", "tests"]}

[tool.ruff.lint.pep8-naming]
extend-ignore-names = ["T"]

[tool.ruff.lint.per-file-ignores]
"**/tests/*" = ["D"]

[tool.rye]
dev-dependencies = [
# Dev
# dev
"bump-my-version>=0.23.0",
"pre-commit>=3.7.1",
# Testing
# tests
"pytest>=8.2.2",
"pyside6>=6.0.0",
]
Expand Down
42 changes: 39 additions & 3 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@
absl-py==2.1.0
# via tensorboard
# via tensorflow
annotated-types==0.7.0
# via pydantic
asttokens==2.4.1
# via stack-data
astunparse==1.6.3
# via tensorflow
bracex==2.4
# via wcmatch
bump-my-version==0.23.0
cachetools==5.3.3
# via google-auth
certifi==2024.6.2
Expand All @@ -23,6 +28,9 @@ cfgv==3.4.0
# via pre-commit
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via bump-my-version
# via rich-click
contourpy==1.2.1
# via matplotlib
cycler==0.12.1
Expand Down Expand Up @@ -70,7 +78,7 @@ iniconfig==2.0.0
ipydatawidgets==4.3.2
# via pythreejs
# via sionna
ipython==8.25.0
ipython==8.18.0
# via ipywidgets
ipywidgets==8.0.5
# via ipydatawidgets
Expand All @@ -94,12 +102,16 @@ libclang==18.1.1
# via tensorflow
markdown==3.6
# via tensorboard
markdown-it-py==3.0.0
# via rich
markupsafe==2.1.5
# via werkzeug
matplotlib==3.9.0
# via sionna
matplotlib-inline==0.1.7
# via ipython
mdurl==0.1.2
# via markdown-it-py
mitsuba==3.5.2
# via sionna
ml-dtypes==0.3.2
Expand Down Expand Up @@ -140,8 +152,9 @@ platformdirs==4.2.2
pluggy==1.5.0
# via pytest
pre-commit==3.7.1
prompt-toolkit==3.0.47
prompt-toolkit==3.0.36
# via ipython
# via questionary
protobuf==4.25.3
# via tensorboard
# via tensorflow
Expand All @@ -154,8 +167,16 @@ pyasn1==0.6.0
# via rsa
pyasn1-modules==0.4.0
# via google-auth
pydantic==2.7.4
# via bump-my-version
# via pydantic-settings
pydantic-core==2.18.4
# via pydantic
pydantic-settings==2.3.3
# via bump-my-version
pygments==2.18.0
# via ipython
# via rich
pyparsing==3.1.2
# via matplotlib
pyside6==6.7.1
Expand All @@ -168,15 +189,24 @@ pyside6-essentials==6.7.1
pytest==8.2.2
python-dateutil==2.9.0.post0
# via matplotlib
python-dotenv==1.0.1
# via pydantic-settings
pythreejs==2.4.2
# via sionna
pyyaml==6.0.1
# via pre-commit
questionary==2.0.1
# via bump-my-version
requests==2.32.3
# via requests-oauthlib
# via tensorboard
requests-oauthlib==2.0.0
# via google-auth-oauthlib
rich==13.7.1
# via bump-my-version
# via rich-click
rich-click==1.8.3
# via bump-my-version
rsa==4.9
# via google-auth
scipy==1.13.1
Expand Down Expand Up @@ -211,6 +241,8 @@ tensorflow-io-gcs-filesystem==0.37.0
# via tensorflow
termcolor==2.4.0
# via tensorflow
tomlkit==0.12.5
# via bump-my-version
traitlets==5.14.3
# via ipython
# via ipywidgets
Expand All @@ -220,14 +252,18 @@ traitlets==5.14.3
traittypes==0.2.1
# via ipydatawidgets
typing-extensions==4.12.2
# via ipython
# via pydantic
# via pydantic-core
# via rich-click
# via tensorflow
urllib3==2.2.1
# via requests
virtualenv==20.26.2
# via pre-commit
vispy==0.14.2
# via sionna-vispy
wcmatch==8.5.2
# via bump-my-version
wcwidth==0.2.13
# via prompt-toolkit
werkzeug==3.0.3
Expand Down
1 change: 1 addition & 0 deletions src/sionna_vispy/__version__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.18.0"
4 changes: 2 additions & 2 deletions src/sionna_vispy/previewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ def _plot_mesh(self, vertices, faces, persist, colors=None):
mesh = Mesh(
vertices=vertices, faces=faces, vertex_colors=colors, shading="flat"
)
mesh.shading_filter.ambiant_light = (1, 1, 1, 0.8)
mesh.shading_filter.ambiant_light = (1, 1, 1, 0.8) # type: ignore
self._add_child(mesh, pmin, pmax, persist=persist)

def _plot_points(self, points, persist, colors=None, radius=0.05):
Expand Down Expand Up @@ -459,7 +459,7 @@ def _plot_points(self, points, persist, colors=None, radius=0.05):
size=2 * radius,
edge_width_rel=0.05,
face_color=colors,
scaling=True,
scaling="scene",
alpha=0.5, # type: ignore[reportArgumentType]
)
self._add_child(markers, pmin, pmax, persist=persist)
Expand Down

0 comments on commit 694565b

Please sign in to comment.