diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54391b2..427fc0c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: version: ${{ matrix.pdm-version }} # The version of PDM to install. Leave it as empty to use the latest version from PyPI, or 'head' to use the latest version from GitHub prerelease: true # Allow prerelease versions of PDM to be installed enable-pep582: false # Enable PEP 582 package loading globally - allow-python-prereleases: true # Allow prerelease versions of Python to be installed. For example if only 3.12-dev is available, 3.12 will fallback to 3.12-dev + allow-python-prereleases: true # Allow prerelease versions of Python to be installed. For example if only 3.12-dev is available, 3.12 will fall back to 3.12-dev - name: Set Cache Variables id: set_variables run: | diff --git a/pyproject.toml b/pyproject.toml index 0c3967e..c16fcb4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "pdm.backend" [project] name = "sync-pre-commit-lock" -version = "0.2.0" +version = "0.2.1" description = "PDM plugin to sync your pre-commit versions with your lockfile, and install them, all automatically." authors = [{ name = "Gabriel Dugny", email = "sync-pre-commit-lock@dugny.me" }] dependencies = [ @@ -121,4 +121,4 @@ exclude_lines = [ # We must configure Poetry as well 🤦 [tool.poetry] name = "sync-pre-commit-lock" -version = "0.1.0" +version = "0.2.1" diff --git a/src/sync_pre_commit_lock/config.py b/src/sync_pre_commit_lock/config.py index e696f05..6398dda 100644 --- a/src/sync_pre_commit_lock/config.py +++ b/src/sync_pre_commit_lock/config.py @@ -45,7 +45,7 @@ class SyncPreCommitLockConfig: def load_config(path: Path | None = None) -> SyncPreCommitLockConfig: - # XXX We Should not hardcode this, and get the filename from PDM/Poetry/custom resolution + # XXX We should not hard-code this, and get the filename from PDM/Poetry/custom resolution path = path or Path("pyproject.toml") with path.open("rb") as file: config_dict = toml.load(file) diff --git a/src/sync_pre_commit_lock/pdm_plugin.py b/src/sync_pre_commit_lock/pdm_plugin.py index 700dbdf..e17ee84 100644 --- a/src/sync_pre_commit_lock/pdm_plugin.py +++ b/src/sync_pre_commit_lock/pdm_plugin.py @@ -89,9 +89,9 @@ def on_pdm_install_setup_pre_commit( def on_pdm_lock_check_pre_commit( project: Project, *, resolution: dict[str, Candidate], dry_run: bool, **kwargs: Any ) -> None: - plugin_config: SyncPreCommitLockConfig = load_config() - printer = PDMPrinter(project.core.ui) project_root: Path = project.root + plugin_config: SyncPreCommitLockConfig = load_config(project_root / project.PYPROJECT_FILENAME) + printer = PDMPrinter(project.core.ui) file_path = project_root / plugin_config.pre_commit_config_file resolved_packages: dict[str, GenericLockedPackage] = {