Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(action): fix check package versions #26

Merged
merged 2 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ runs:

- name: Check for invalid package versions in pyproject.toml
run: |
poetry install --directory ${{ github.action_path }}
poetry run --directory ${{ github.action_path }} invalid_package_versions
poetry install
poetry run invalid_package_versions ${{ inputs.working_directory }}/pyproject.toml
shell: bash
working-directory: ${{ github.workspace }}
working-directory: ${{ github.action_path }}

- name: Create virtualenv and install dependencies
shell: bash
Expand Down
3 changes: 2 additions & 1 deletion action_setup_python_poetry/invalid_package_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ def get_invalid_package_versions(pyproject_toml_file_text: str) -> Sequence[tupl


def main():
if invalid_versions := get_invalid_package_versions(Path("pyproject.toml").read_text()):
pyproject_path = Path(sys.argv[1] if len(sys.argv) > 1 else "pyproject.toml")
if invalid_versions := get_invalid_package_versions(pyproject_path.read_text()):
print(f"Invalid package versions found in pyproject.toml: {invalid_versions}")
sys.exit(1)

Expand Down
Loading