Skip to content

Build to ignore certain directory before passing to backend #904

@Raven888888

Description

@Raven888888

Versions

  • python 3.10
  • build 1.2.2.post1

Directory structure

- pyproject.toml
- mymodule/
- mountFolder/
- .gitignore
- .buildignore
- README.md

Content of pyproject.toml

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "xxx"
description = "xxx"
dynamic = ["version"]

[tool.hatch.version]
path = "mymodule/__init__.py"

[tool.hatch.build]
include = [
    "mymodule/"
    ".gitignore",
    "README.md"
    "pyproject.toml"
]
exclude = [
    "mountFolder/"
]

Content of .buildignore and .gitignore

mountFolder/

My problem is, the mountFolder/ is huge and slow (over network), when building the wheel, it will take ages, even though I already specify in toml file to exclude the specific folder. It seems like build will still scan regardless, before passing to the backend hatch?

How can I prevent build from scanning the mount folder? Will symlink works?

PS: I cannot move the mountFolder/ out from the project root unfortunately, due to legacy reasons.

Appreciate any help!

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