diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 0000000..cfe9d93 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,19 @@ +# Development + +## Installing plugin to debug + +Build wheels and install them with a shortcut script: + +```bash +./scripts/install_plugin.sh +``` + +## Publishing + +Increment the package version, build the distribution and publish the latest version: + +```bash +bump-my-version bump patch +uv build +UV_PUBLISH_TOKEN= uv publish +``` diff --git a/pyproject.toml b/pyproject.toml index f0a7c74..c5dbd6b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ dev = [ "pytest-stub>=1.1.0", "pytest>=8.3.5", "pytest-virtualenv>=1.8.1", + "bump-my-version>=1.1.4", ] [build-system] @@ -83,3 +84,25 @@ name = "testpypi" url = "https://test.pypi.org/simple/" publish-url = "https://test.pypi.org/legacy/" explicit = true + +[tool.bumpversion] +current_version = "0.1.3" +parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" +serialize = ["{major}.{minor}.{patch}"] +search = "{current_version}" +replace = "{new_version}" +regex = false +ignore_missing_version = false +ignore_missing_files = false +tag = true +sign_tags = false +tag_name = "v{new_version}" +tag_message = "Bump version: {current_version} → {new_version}" +allow_dirty = false +commit = true +message = "Bump version: {current_version} → {new_version}" +moveable_tags = [] +commit_args = "" +setup_hooks = [] +pre_commit_hooks = [] +post_commit_hooks = [] diff --git a/scripts/install_plugin.sh b/scripts/install_plugin.sh new file mode 100755 index 0000000..adec831 --- /dev/null +++ b/scripts/install_plugin.sh @@ -0,0 +1,10 @@ +#~/bin/bash +pipx uninject python-lsp-server starkiller +echo "Removed old Starkiller" + +uv build +echo "New version ready" + +WHEEL=`ls ./dist/starkiller-*-none-any.whl | sort -V | tail -1` +pipx inject python-lsp-server ${WHEEL}[pylsp] -f +echo "Installed ${WHEEL}" diff --git a/starkiller/project.py b/starkiller/project.py index 9c6d2df..6bd38cb 100644 --- a/starkiller/project.py +++ b/starkiller/project.py @@ -143,7 +143,7 @@ def _find_definitions_follow_import( inames: set[ImportedName], find_definitions: set[str] ) -> set[str]: - module_short_name = module_name.split(".")[-1] + module_short_name = module_name.rsplit(".", maxsplit=1)[-1] found_definitions: set[str] = set() is_star = any(iname.name == "*" for iname in inames) diff --git a/starkiller/py.typed b/starkiller/py.typed new file mode 100644 index 0000000..e69de29