Skip to content

Commit 9aef27b

Browse files
author
Yusuke Oda
authored
Release scripts (#95)
* add release workflow * add script
1 parent 6a43f2b commit 9aef27b

File tree

3 files changed

+40
-15
lines changed

3 files changed

+40
-15
lines changed

.github/workflows/release.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Release workflow
2+
3+
on:
4+
push:
5+
tags:
6+
- "v[0123456789].*"
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: checkout
13+
uses: actions/checkout@v3
14+
- name: setup python
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: "3.10"
18+
- name: build
19+
run: |
20+
echo "__version__ = \"${GITHUB_REF_NAME:1}\"" > src/latexify/_version.py
21+
python -m pip install --upgrade build
22+
python -m build
23+
- name: publish
24+
uses: pypa/gh-action-pypi-publish@release/v1
25+
with:
26+
password: ${{ secrets.PYPI_API_TOKEN }}

pyproject.toml

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ build-backend = "hatchling.build"
66

77
[project]
88
name = "latexify-py"
9-
version = "0.1.1"
109
description = "Generates LaTeX math description from Python functions."
1110
readme = "README.md"
1211
requires-python = ">=3.7, <3.11"
@@ -36,6 +35,9 @@ classifiers = [
3635
dependencies = [
3736
"dill>=0.3.2",
3837
]
38+
dynamic = [
39+
"version"
40+
]
3941

4042
[project.optional-dependencies]
4143
dev = [
@@ -64,6 +66,9 @@ only-packages = true
6466
[tool.hatch.build.targets.wheel]
6567
packages = ["src/latexify"]
6668

69+
[tool.hatch.version]
70+
path = "src/latexify/_version.py"
71+
6772
[tool.flake8]
6873
max-line-length = 88
6974
extend-ignore = "E203"

src/latexify/__init__.py

+8-14
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
# Copyright 2020 Google LLC
2-
#
3-
# Licensed under the Apache License, Version 2.0 (the "License");
4-
# you may not use this file except in compliance with the License.
5-
# You may obtain a copy of the License at
6-
#
7-
# http://www.apache.org/licenses/LICENSE-2.0
8-
#
9-
# Unless required by applicable law or agreed to in writing, software
10-
# distributed under the License is distributed on an "AS IS" BASIS,
11-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
# See the License for the specific language governing permissions and
13-
# limitations under the License.
14-
"""Latexify toplevel module."""
1+
"""Latexify root package."""
2+
3+
try:
4+
from latexify import _version
5+
6+
__version__ = _version.__version__
7+
except:
8+
__version__ = ""
159

1610
from latexify import frontend
1711

0 commit comments

Comments
 (0)