Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,28 @@
name: deploy
name: Publish to PyPI

on:
push:
tags:
- 'v*'
- "v*"
workflow_dispatch:

jobs:
deploy:
publish:
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/cp2k-lsp-enhanced
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: snok/install-poetry@v1.3.4
- run: poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
- run: poetry publish --build
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- uses: snok/install-poetry@v1.3.4
- name: Build distribution
run: poetry build
- name: Publish distribution
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## [0.1.0] - 2026-07-16

- Publish the enhanced OpenQC CP2K language server under the independent
`cp2k-lsp-enhanced` distribution identity.
- Preserve the `cp2k-language-server` compatibility command and upstream
Python import namespace.
- Replace token-based deployment with PyPI trusted publishing through the
protected `pypi` environment.

## [0.9.2] - 2026-02-xy

Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# cp2k-input-tools
# cp2k-lsp-enhanced

[![Build status](https://github.com/cp2k/cp2k-input-tools/actions/workflows/test.yml/badge.svg)](https://github.com/cp2k/cp2k-input-tools/actions) [![codecov](https://codecov.io/gh/cp2k/cp2k-input-tools/branch/develop/graph/badge.svg)](https://codecov.io/gh/cp2k/cp2k-input-tools) [![PyPI](https://img.shields.io/pypi/pyversions/cp2k-input-tools)](https://pypi.org/project/cp2k-input-tools/)
[![Build status](https://github.com/newtontech/cp2k-lsp-enhanced/actions/workflows/test.yml/badge.svg)](https://github.com/newtontech/cp2k-lsp-enhanced/actions) [![PyPI](https://img.shields.io/pypi/pyversions/cp2k-lsp-enhanced)](https://pypi.org/project/cp2k-lsp-enhanced/)

This Newton Technology distribution extends the upstream
`cp2k-input-tools` project with the OpenQC language-server, agent CLI, and
traceability contract. The Python import namespace and the
`cp2k-language-server` command remain compatible with the upstream project.

Fully validating pure-python CP2K input file parsers including preprocessing capabilities

Expand Down Expand Up @@ -54,19 +59,19 @@ When changing CP2K language-server behavior, parser validation, command names, f
You will get most tools using simply:

```console
$ pip install cp2k-input-tools
$ pip install cp2k-lsp-enhanced
```

For YAML support you should use

```console
$ pip install cp2k-input-tools[yaml]
$ pip install cp2k-lsp-enhanced[yaml]
```

and for the Language Server:

```console
$ pip install cp2k-input-tools[lsp]
$ pip install cp2k-lsp-enhanced[lsp]
```

## Command Line Interface
Expand Down
2 changes: 1 addition & 1 deletion cp2k_input_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import pathlib

__version__ = "0.9.1"
__version__ = "0.1.0"

DEFAULT_CP2K_INPUT_XML = pathlib.Path(__file__).resolve().parent.joinpath("cp2k_input.xml")
6 changes: 3 additions & 3 deletions cp2k_input_tools/cli/lsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

import click

LSP_EXTRA_ERROR = """Could not import the pygls package. You have to install the cp2k-input-tools with the 'lsp' extra:
LSP_EXTRA_ERROR = """Could not import the pygls package. Install cp2k-lsp-enhanced with the 'lsp' extra:

pip install cp2k-input-tools[lsp]
"""
pip install cp2k-lsp-enhanced[lsp]
"""


@click.command()
Expand Down
13 changes: 8 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
[tool.poetry]
name = "cp2k-input-tools"
version = "0.9.1"
description = "Python tools to handle CP2K input files"
authors = ["Tiziano Müller <tiziano.mueller@chem.uzh.ch>"]
repository = "https://github.com/cp2k/cp2k-input-tools"
name = "cp2k-lsp-enhanced"
version = "0.1.0"
description = "Enhanced CP2K language server and input tooling for OpenQC"
authors = [
"Newton Technology",
"Tiziano Müller <tiziano.mueller@chem.uzh.ch>",
]
repository = "https://github.com/newtontech/cp2k-lsp-enhanced"
license = "MIT"
classifiers = [
"Development Status :: 4 - Beta",
Expand Down
30 changes: 30 additions & 0 deletions tests/test_release_contract.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
from __future__ import annotations

from pathlib import Path

try:
import tomllib
except ModuleNotFoundError: # pragma: no cover - Python 3.10 compatibility
import tomli as tomllib

ROOT = Path(__file__).resolve().parents[1]


def test_newtontech_distribution_identity_and_compatibility_command() -> None:
metadata = tomllib.loads((ROOT / "pyproject.toml").read_text(encoding="utf-8"))
poetry = metadata["tool"]["poetry"]

assert poetry["name"] == "cp2k-lsp-enhanced"
assert poetry["version"] == "0.1.0"
assert poetry["repository"] == "https://github.com/newtontech/cp2k-lsp-enhanced"
assert poetry["scripts"]["cp2k-language-server"] == ("cp2k_input_tools.cli.lsp:cp2k_language_server")
assert poetry["scripts"]["cp2k-lsp-tool"] == "cp2k_input_tools.tool:main"


def test_pypi_release_uses_oidc_and_protected_environment() -> None:
workflow = (ROOT / ".github" / "workflows" / "deploy.yml").read_text(encoding="utf-8")

assert "name: pypi" in workflow
assert "id-token: write" in workflow
assert "PYPI_TOKEN" not in workflow
assert "pypa/gh-action-pypi-publish@" in workflow
Loading