Giter Club home page Giter Club logo

python-monorepo's People

Contributors

ya-mori avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python-monorepo's Issues

relative paths fail in Dockerfile

How do you manage relative paths in pyproject.toml when you dockerize the project? For example in project-one there is

lib-one = {path = "../../libs/lib-one"}

This of course makes docker build fail with a simple Dockerfile like the following

FROM python:3.9

WORKDIR /code
RUN pip install poetry==1.1.13

COPY ./pyproject.toml ./poetry.lock* /code/
RUN poetry install --no-dev

COPY ./src /code

document README fix

Thaks for the great code example.

the command to start example 2 API is

poetry run python api

Hope this help someone

Transitive dependencies cannot be built

I am trying to build project-one. However, when it tries to build lib-one, it also needs to build the logging lib, which fails.
I think, it has to do with the relative paths, that don't match depending from where you build the porject.

Can you tell me what I am doing wrong?

Steps to reproduce

  1. Checkout the repo
  2. run poetry install
  3. run cd projects/project-one
  4. run poetry install
• Installing lib-one (0.1.0 xxx/python-monorepo/libs/lib-one): Failed

  EnvCommandError

  Command ['/xxx/.cache/pypoetry/virtualenvs/project-one-fVJqddUj-py3.8/bin/pip', 'install', '--no-deps', '-U', 'xxx/python-monorepo/libs/lib-one'] errored with the following return code 1, and output: 
  Looking in indexes: xxx (private repo)
  Processing xxx/python-monorepo/libs/lib-one
    Installing build dependencies: started
    Installing build dependencies: finished with status 'done'
    Getting requirements to build wheel: started
    Getting requirements to build wheel: finished with status 'done'
      Preparing wheel metadata: started
      Preparing wheel metadata: finished with status 'error'
      ERROR: Command errored out with exit status 1:
       command: xxx/.cache/pypoetry/virtualenvs/project-one-fVJqddUj-py3.8/bin/python xxx/.cache/pypoetry/virtualenvs/project-one-fVJqddUj-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp_wre553_
           cwd: /tmp/pip-req-build-4beifv24
      Complete output (16 lines):
      Traceback (most recent call last):
        File "xxx/.cache/pypoetry/virtualenvs/project-one-fVJqddUj-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
          main()
        File "xxx/.cache/pypoetry/virtualenvs/project-one-fVJqddUj-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "xxx/.cache/pypoetry/virtualenvs/project-one-fVJqddUj-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 133, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
        File "/tmp/pip-build-env-i0p3l6n2/overlay/lib/python3.8/site-packages/poetry/core/masonry/api.py", line 34, in prepare_metadata_for_build_wheel
          poetry = Factory().create_poetry(Path(".").resolve())
        File "/tmp/pip-build-env-i0p3l6n2/overlay/lib/python3.8/site-packages/poetry/core/factory.py", line 91, in create_poetry
          self.create_dependency(name, constraint, root_dir=package.root_dir)
        File "/tmp/pip-build-env-i0p3l6n2/overlay/lib/python3.8/site-packages/poetry/core/factory.py", line 242, in create_dependency
          dependency = DirectoryDependency(
        File "/tmp/pip-build-env-i0p3l6n2/overlay/lib/python3.8/site-packages/poetry/core/packages/directory_dependency.py", line 36, in __init__
          raise ValueError("Directory {} does not exist".format(self._path))
      ValueError: Directory ../logger does not exist
      ----------------------------------------
  ERROR: Command errored out with exit status 1: xxx/.cache/pypoetry/virtualenvs/project-one-fVJqddUj-py3.8/bin/python xxx/.cache/pypoetry/virtualenvs/project-one-fVJqddUj-py3.8/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp_wre553_ Check the logs for full command output.
  

  at ~/.local/lib/python3.8/site-packages/poetry/utils/env.py:948 in _run
       944│                 output = subprocess.check_output(
       945│                     cmd, stderr=subprocess.STDOUT, **kwargs
       946│                 )
       947│         except CalledProcessError as e:
    →  948│             raise EnvCommandError(e, input=input_)
       949│ 
       950│         return decode(output)
       951│ 
       952│     def execute(self, bin, *args, **kwargs):

Thank you for this project!

I'm surprised more projects (e.g. poetry, pip, jupyter, ipython) don't use and encourage monorepos

Do you know any open source python projects using monorepos?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.