Skip to content

option not to copy files #8

@hydrargyrum

Description

@hydrargyrum

Current Situation

I have this config

[[tool.hatch.build.hooks.build-scripts.scripts]]
artifacts = ["pjy.1"]
commands = [
    "asciidoctor -b manpage pjy.adoc",
]

So I'm building pjy.1 file into the repo root dir. Then for some reason hatch-build-scripts tries to copy the built file $/pjy.1 into out dir $/pjy.1, which obviously fails:

  File "/tmp/1000/build-env-pvakc__9/lib/python3.13/site-packages/hatch_build_scripts/plugin.py", line 60, in initialize
    shutil.copyfile(src_file, out_file)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/shutil.py", line 240, in copyfile
    raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
shutil.SameFileError: PosixPath('/tmp/1000/release-pjy.fbWHAl/pjy.1') and PosixPath('/tmp/1000/release-pjy.fbWHAl/pjy.1') are the same file

ERROR Backend subprocess exited when trying to invoke build_sdist

Proposed Actions

Either

  • don't call copyfile if the source is the same as the destination
  • or propose an option not to copy artifacts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions