Coder Social home page Coder Social logo

Comments (7)

fschulze avatar fschulze commented on June 20, 2024

Does this happen with both devpi-client 6.x and 7.x?

With the current version, could you try isolated=not self.args.no_isolation. That seems to be the most sensible fix.

As an optimization, we could look into getting the metadata from previously built artifacts like wheels and pass that on to the documentation building step.

from devpi.

eachimei avatar eachimei commented on June 20, 2024

Does this happen with both devpi-client 6.x and 7.x?

No, it started happening only with 7.0.0 due to the switch from pep517 to build. As I will show below, the switch changed important functionality aspects.

As can be seen, the relevant commit included in 7.0.0:
8bd048d#diff-654fa2126392edd2daaa3b4f621ad8805e93d9ab5096727fd704dcbd222ce54fL394

The "old" code was:

    def setup_name_and_version(self):
        result = pep517.meta.load(self.rootpath.strpath)

And if we track down pep517.meta.load() we can see the it winds up to:
https://github.com/pypa/pyproject-hooks/blob/v0.13.0/pep517/meta.py#L53

# eachimei: `pep517.meta.load` runs this:
def build(source_dir='.', dest=None, system=None):
    system = system or load_system(source_dir)
    dest = os.path.join(source_dir, dest or 'dist')
    os.makedirs(dest, exist_ok=True)
    validate_system(system)
    hooks = Pep517HookCaller(
        source_dir, system['build-backend'], system.get('backend-path')
    )

    with hooks.subprocess_runner(quiet_subprocess_runner):
        with BuildEnvironment() as env:                # <--- eachimei: isolated environment
            env.pip_install(system['requires'])        # <--- eachimei: install the build system requirements

Therefore, it seems that for "apples to apples" switch from pep517 to build, we should run with isolated=True (as described in this issue body):

    def setup_name_and_version(self):
        try:
            metadata = build.util.project_wheel_metadata(
                str(self.rootpath), isolated=False)    # <--- change to isolated=True, at least as a default

from devpi.

fschulze avatar fschulze commented on June 20, 2024

Thanks for the detailed explanation. I think isolated=not self.args.no_isolation is the correct fix then, as it would do isolated builds by default, but with the --no-isolation option it would build both the releases and the docs with no isolation, so no surprises for either case.

from devpi.

eachimei avatar eachimei commented on June 20, 2024

Thanks! I haven't got to give it a try yet, but it makes sense and sounds good!

from devpi.

eachimei avatar eachimei commented on June 20, 2024

Tested isolated=not self.args.no_isolation and it looks good, works as expected.

from devpi.

eachimei avatar eachimei commented on June 20, 2024

PR with the fix: #1009

from devpi.

eachimei avatar eachimei commented on June 20, 2024

Thanks @fschulze ! 😃

from devpi.

Related Issues (20)

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.