Skip to content

Commit

Permalink
Release v0.2.14 (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart authored Jun 29, 2024
1 parent 14b10cf commit 440c84e
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 28 deletions.
25 changes: 2 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,9 @@ jobs:
with:
python-version: 3.x
- name: Install dependencies
run: pip install hatch
run: pip install hatch httpx
- name: Create packages
run: |
hatch build
cd txl; hatch build ../dist; cd ..
cd plugins/cell; hatch build ../../dist; cd ../..
cd plugins/console; hatch build ../../dist; cd ../..
cd plugins/editors; hatch build ../../dist; cd ../..
cd plugins/file_browser; hatch build ../../dist; cd ../..
cd plugins/image_viewer; hatch build ../../dist; cd ../..
cd plugins/jpterm; hatch build ../../dist; cd ../..
cd plugins/kernel; hatch build ../../dist; cd ../..
cd plugins/local_contents; hatch build ../../dist; cd ../..
cd plugins/local_terminals; hatch build ../../dist; cd ../..
cd plugins/local_kernels; hatch build ../../dist; cd ../..
cd plugins/notebook_editor; hatch build ../../dist; cd ../..
cd plugins/remote_contents; hatch build ../../dist; cd ../..
cd plugins/remote_terminals; hatch build ../../dist; cd ../..
cd plugins/remote_kernels; hatch build ../../dist; cd ../..
cd plugins/text_editor; hatch build ../../dist; cd ../..
cd plugins/markdown_viewer; hatch build ../../dist; cd ../..
cd plugins/terminal; hatch build ../../dist; cd ../..
cd plugins/launcher; hatch build ../../dist; cd ../..
cd plugins/widgets; hatch build ../../dist; cd ../..
run: python publish.py
- name: Archive packages
uses: actions/upload-artifact@v4
with:
Expand Down
1 change: 0 additions & 1 deletion jpterm/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
__version__ = "0.2.13"
40 changes: 40 additions & 0 deletions publish.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import subprocess
from pathlib import Path

import httpx
import tomllib


def run(cmd: str, cwd: str | None = None) -> list[str]:
res = subprocess.run(cmd.split(), capture_output=True, cwd=cwd)
return res.stdout.decode().splitlines()


pyproject = tomllib.load(open("pyproject.toml", "rb"))
for dependency in pyproject["project"]["dependencies"]:
idx = dependency.find("==")
version = dependency[idx + 2:].strip()
package = dependency[:idx].strip()
if package.startswith("txl"):
response = httpx.get(f"https://pypi.org/pypi/{package}/json")
releases = response.json()["releases"].keys()
if version not in releases:
print(f"Building {package}-{version}")
package_dir = Path()
dist_dir = "../dist"
if package != "txl":
package_dir /= "plugins"
dist_dir = f"../{dist_dir}"
package_dir /= package
run(f"hatch build {dist_dir}", cwd=str(package_dir))
for path in Path("dist").iterdir():
if f"{package}-{version}" in path.name:
break
else:
raise RuntimeError(
f"Wrong version for package {package}: did you forget to bump it to {version}?"
)


print("Building jpterm")
run("hatch build")
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "jpterm"
dynamic = ["version"]
version = "0.2.14"
description = "Jupyter in the terminal"
readme = "README.md"
license = { text = "MIT" }
Expand All @@ -25,7 +25,7 @@ keywords = [
]
dependencies = [
"rich-click >=1.6.0",
"txl ==0.2.13",
"txl ==0.2.14",
"txl_cell ==0.2.13",
"txl_console ==0.2.13",
"txl_editors ==0.2.13",
Expand Down
2 changes: 1 addition & 1 deletion txl/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ classifiers = [
]
dependencies = [
"asphalt >=4.12.0,<5",
"textual[syntax] >=0.70.0,<0.71.0",
"textual[syntax] >=0.71.0,<0.72.0",
]
dynamic = ["version"]

Expand Down
2 changes: 1 addition & 1 deletion txl/txl/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.13"
__version__ = "0.2.14"

0 comments on commit 440c84e

Please sign in to comment.