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

[Question] requirements.txt regen #14

Open
psadi opened this issue May 18, 2024 · 3 comments
Open

[Question] requirements.txt regen #14

psadi opened this issue May 18, 2024 · 3 comments

Comments

@psadi
Copy link

psadi commented May 18, 2024

Does the workflow re-generate requirements.txt file in case there are dependency updates ?

@frostming
Copy link
Contributor

Yes if you installed pdm-autoexport plugin

@psadi psadi closed this as completed May 22, 2024
@psadi
Copy link
Author

psadi commented Jun 9, 2024

Please help to understand what I'm doing wrong here, as per suggestion i added pdm-auto-export plugin, Please find my pyproject.toml

[project]
name = "bb"
dynamic = ["version"]
description = "Work seamlessly with BitBucket from the command line."
authors = [{ name = "psadi", email = "ps.adithya@icloud.com" }]
dependencies = ["typer[all]>=0.7.0", "httpx>=0.24.0"]
requires-python = ">=3.8"
readme = "README.md"
license = { text = "MIT" }

[project.scripts]
bb = "bb:_bb"

[build-system]
requires = ["pdm-pep517>=1.0"]
build-backend = "pdm.pep517.api"

[tool.pdm]
version = { source = "file", path = "bb/__version__.py" }

[tool.pdm.build]
includes = ["bb"]
excludes = ["tests"]

[tool.pdm.dev-dependencies]
dev = [
    "pytest>=7.2.1",
    "tox>=4.4.5",
    "pytest-cov>=4.0.0",
    "tox-pdm>=0.6.1",
    "ruff>=0.0.257",
    "bandit>=1.7.5",
    "pyyaml>=6.0.1",
]

[[tool.pdm.autoexport]]
filename = "requirements.txt"
without-hashes = true

[tool.pdm.scripts]
bb = { call = "bb:_bb" }

[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"

[tool.ruff.lint]
extend-select = ["I"]
ignore = ["E501"]

[tool.bandit]
skips = ["B404", "B603", "B607"]

Please find the github-actions.yaml

name: Update dependencies

on:
  schedule:
    - cron: 0 0 * * 0

jobs:
  update-dependencies:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0

      - name: Update dependencies
        uses: pdm-project/update-deps-action@main
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          commit-message: "chore: Update pdm.lock"
          pr-title: "auto: Update dependencies"
          update-strategy: reuse
          save-strategy: minimum
          unconstrained: false
          install-plugins: "false"
          sign-off-commit: "false"

Dependency update + PR Generation is happening properly. However the requirements.txt is not being generated as part of the update action. However the file is generated when i update locally.

Attaching logs - 0_update-dependencies.txt

@psadi psadi reopened this Jun 9, 2024
@frostming
Copy link
Contributor

frostming commented Jun 9, 2024

configure the plugin in Project https://pdm-project.org/en/latest/dev/write/#specify-the-plugins-in-project

and turn on the install-plugins option because pdm-autoexport is a plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants