Skip to content

Commit

Permalink
Merge pull request #7 from RIMS-Code/dev1
Browse files Browse the repository at this point in the history
Improvements for `dev1` release

- move script to gui-scripts, add project urls to pyproject.toml
- fix code-coverage upload workflow
- add pre-commit hook
- Add button to reset formatting
- add transition strength to gui
- update strings to utilize f-strings
- automatically add json suffix when saving config
- add transition strength to plots
- add release workflow
  • Loading branch information
trappitsch authored Feb 12, 2024
2 parents 05fea73 + 9032c1e commit 5192d1c
Show file tree
Hide file tree
Showing 9 changed files with 301 additions and 72 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/package_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
run: |
rye run test_cov
- name: Upload coverage reports to Codecov
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION && github.repository_owner == 'galactic-forensics' }}
if: ${{ matrix.python-version == env.MAIN_PYTHON_VERSION && github.repository_owner == 'RIMS-Code' }}
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release creation

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

env:
PYTHON_VERSION: "3.12"

jobs:
build-linux:
name: Release on PyPi
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install the latest version of rye
uses: eifinger/setup-rye@v1
- name: Sync Rye
run: |
rye pin ${{ env.PYTHON_VERSION }}
rye sync
- name: Build and release the controller
run: |
rye build
rye publish --token ${{ secrets.PYPI_TOKEN }} --yes
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ tkinter_version/RIMSSchemeDrawer_RT.command
*.pyc
div
div/*
__pycache__/
*.py[co]
.DS_Store
*.log

# PyCharm
.idea

# Python virtual environments
.venv
venv
venv/*
.python-version
Expand All @@ -33,3 +38,5 @@ target/*

# builds
dist/
*.egg-info/
*.dist-info/
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.2.1
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: [ --py38-plus ]
10 changes: 8 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "rimsschemedrawer"
version = "3.0.0.dev0"
version = "3.0.0.dev1"
description = "Drawing of RIMS schemes in python and/or with a Python GUI."
authors = [
{ name = "Reto Trappitsch", email = "[email protected]" }
Expand All @@ -13,7 +13,7 @@ readme = "README.md"
requires-python = ">= 3.8"
license = { text = "MIT" }

[project.scripts]
[project.gui-scripts]
rimsschemedrawer = "rimsschemedrawer.app:run_gui"

[project.optional-dependencies]
Expand All @@ -22,6 +22,12 @@ gui = [
"qtpy>=2.4.1",
]

[project.urls]
Homepage = "https://github.com/RIMS-Code/RIMSSchemeDrawer"
Documentation = "https://github.com/RIMS-Code/RIMSSchemeDrawer"
Repository = "https://github.com/RIMS-Code/RIMSSchemeDrawer.git"
Issues = "https://github.com/RIMS-Code/RIMSSchemeDrawer/issues"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
Expand Down
Loading

0 comments on commit 5192d1c

Please sign in to comment.