Skip to content

Commit

Permalink
Merge pull request #144 from mechmotum/initial-release
Browse files Browse the repository at this point in the history
Initial release
  • Loading branch information
tjstienstra authored Oct 12, 2024
2 parents 0e93b7e + 04d2cc4 commit 4e04e0d
Show file tree
Hide file tree
Showing 7 changed files with 257 additions and 130 deletions.
32 changes: 32 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'bug'
- title: '🧰 Maintenance'
label: 'chore'
- title: '💥 Breaking Changes'
label: 'breaking'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
exclude-labels:
- 'CI'
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Changes
$CHANGES
24 changes: 24 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release Drafter

on:
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
pull_request_target:
types: [opened, reopened, synchronize]

permissions:
contents: read

jobs:
update_release_draft:
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Release
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry==1.8.3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- run: poetry build
- run: poetry publish --username=__token__ --password=${{ secrets.PYPI_TOKEN }}
27 changes: 27 additions & 0 deletions .github/workflows/test-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: TestPyPI
on:
push:
branches:
- main
jobs:
test_pypi:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install poetry
run: pipx install poetry==1.8.3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- run: >-
poetry version patch &&
version=$(poetry version | awk '{print $2}') &&
poetry version $version.dev.$(date +%s)
- run: poetry build
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/
270 changes: 142 additions & 128 deletions poetry.lock

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "symbrim"
version = "0.0.1"
version = "0.1.0"
description = "A Modular and Extensible Open-Source Framework for Symbolic Creating Bicycle-Rider Models"
authors = ["tjstienstra <[email protected]>"]
license = "CC0-1.0"
Expand All @@ -12,7 +12,8 @@ python = "^3.9"
typing-extensions = "^4.12.2"
sympy = "^1.13"
symmeplot = {version = "^0.2.0", optional = true}
bicycleparameters = {git = "https://github.com/moorepants/BicycleParameters.git", optional = true}
bicycleparameters = {version = "^1.2.0", optional = true}
importlib-metadata = {version = "^8.5.0", python = "<3.8"}

[tool.poetry.group.lint.dependencies]
ruff = "^0.6.9"
Expand Down
11 changes: 11 additions & 0 deletions src/symbrim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
A Modular and Extensible Open-Source Framework for Creating Symbolic Bicycle-Rider
Models.
"""

__all__ = [
"WhippleBicycle", "StationaryBicycle",

Expand Down Expand Up @@ -85,3 +86,13 @@
TwoPinStickLeftLeg,
TwoPinStickRightLeg,
)

try:
from importlib.metadata import PackageNotFoundError, version
except ImportError: # pragma: no cover
from importlib_metadata import PackageNotFoundError, version

try:
__version__ = version(__name__)
except PackageNotFoundError: # pragma: no cover
__version__ = "unknown"

0 comments on commit 4e04e0d

Please sign in to comment.