Skip to content

Contributing guide update for unit testing #98

@MichaelThamm

Description

@MichaelThamm

The Running tests section mentions requirements-dev.txt, but this does not exist. I assume after a migration to pyproject.toml?

I was able to build Terrareg and run it on port 5000 in my Ubuntu VM. But now I want to contribute some code and execute the unit tests to check if my changes are good. So I try to pull in all the deps in the pyproject.toml with the following:

ubuntu@terrareg:~/terrareg$ uv sync --all-extras --all-groups && source .venv/bin/activate
Resolved 76 packages in 1.74s
  × Failed to build `terrareg @ file:///home/ubuntu/terrareg`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `poetry.core.masonry.api.build_editable` failed (exit status: 1)

      [stderr]
      Traceback (most recent call last):
        File "<string>", line 11, in <module>
        File
      "/home/ubuntu/.cache/uv/builds-v0/.tmpHOIjCd/lib/python3.12/site-packages/poetry/core/masonry/api.py",
      line 87, in build_editable
          return WheelBuilder.make_in(
                 ^^^^^^^^^^^^^^^^^^^^^
        File
      "/home/ubuntu/.cache/uv/builds-v0/.tmpHOIjCd/lib/python3.12/site-packages/poetry/core/masonry/builders/wheel.py",
      line 95, in make_in
          wb.build(target_dir=directory)
        File
      "/home/ubuntu/.cache/uv/builds-v0/.tmpHOIjCd/lib/python3.12/site-packages/poetry/core/masonry/builders/wheel.py",
      line 129, in build
          self._add_pth(zip_file)
        File
      "/home/ubuntu/.cache/uv/builds-v0/.tmpHOIjCd/lib/python3.12/site-packages/poetry/core/masonry/builders/wheel.py",
      line 158, in _add_pth
          for include in self._module.includes:
                         ^^^^^^^^^^^^
        File "/usr/lib/python3.12/functools.py", line 995, in __get__
          val = self.func(instance)
                ^^^^^^^^^^^^^^^^^^^
        File
      "/home/ubuntu/.cache/uv/builds-v0/.tmpHOIjCd/lib/python3.12/site-packages/poetry/core/masonry/builders/builder.py",
      line 70, in _module
          return Module(
                 ^^^^^^^
        File
      "/home/ubuntu/.cache/uv/builds-v0/.tmpHOIjCd/lib/python3.12/site-packages/poetry/core/masonry/utils/module.py",
      line 44, in __init__
          raise ValueError(f"Both {pkg_dir} and {py_file} exist")
      ValueError: Both /home/ubuntu/terrareg/terrareg and /home/ubuntu/terrareg/terrareg.py exist

      hint: This usually indicates a problem with the package or the build environment.

I am not sure how to proceed :/

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions