Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devcontainer: Base python 3.10.2 devcontainer #2880

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

heliocastro
Copy link

@heliocastro heliocastro commented Feb 25, 2022

Use VSCode devcontainer infrastructure to allow remote or containerized
development to avoid install multiple depenencies on host machine

Installed:

  • python 3.10.2 ( base official Docker image on debian Bullseye )

Signed-off-by: Helio Chissini de Castro [email protected]

Use VSCode devcontainer infrastructure to allow remote or containerized
development to avoid install multiple depenencied on host machine

Installed:
- python 3.10.2 ( base official Docker image on debian Bullseye )
- Puppet PDK
- PHP 7.4

Signed-off-by: Helio Chissini de Castro <[email protected]>
- Avoid use configure. As we are inside container using non-root user,
  there's no necessity to add an extra virtualenv, so we are installing
  dependencies using pip requirements.
- Add sudo capacity to container
- Remove pdk and php for now. There's no immediate reason to have it and
  introduce it was a mistake on beginning

Signed-off-by: Helio Chissini de Castro <[email protected]>
@pombredanne
Copy link
Member

@heliocastro Thank you++

// "puppet.puppet-vscode",
],
// "postCreateCommand": "./configure --dev",
"postStartCommand": "pip install -r requirements.txt -r requirements-dev.txt"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not be the best command. We use these only as constraints and no longer as plain requirements. See

# Requirement arguments passed to pip and used by default or with --dev.

So IMHO running configure --dev (on all OSes) would be a better option.

@heliocastro
Copy link
Author

I tried, but then this happens, even if i go up to python 3.8. The repos on aboutcode are somehow not behaving properly:

INFO: pip is looking at multiple versions of scancode-toolkit to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of scancode-toolkit[packages] to determine which version is compatible with other requirements. This could take a while.
INFO: pip is looking at multiple versions of scancode-toolkit[dev] to determine which version is compatible with other requirements. This could take a while.
ERROR: Could not find a version that satisfies the requirement setuptools>=40.0 (from pytest-rerunfailures)
ERROR: No matching distribution found for setuptools>=40.0
Traceback (most recent call last):
  File "/workspaces/scancode-toolkit/etc/configure.py", line 76, in call
    subprocess.check_call(
  File "/usr/local/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '"/workspaces/scancode-toolkit/bin/pip" install --upgrade --no-build-isolation --no-index --find-links https://thirdparty.aboutcode.org/pypi --editable .[dev] --editable .[packages] --constraint requirements.txt --constraint requirements-dev.txt' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/workspaces/scancode-toolkit/etc/configure.py", line 331, in <module>
    pip_install(requirement_args, quiet=quiet)
  File "/workspaces/scancode-toolkit/etc/configure.py", line 216, in pip_install
    call(cmd)
  File "/workspaces/scancode-toolkit/etc/configure.py", line 84, in call
    raise Exception('Failed to run {}\n{}'.format(cmd, str(e)))
Exception: Failed to run "/workspaces/scancode-toolkit/bin/pip" install --upgrade --no-build-isolation --no-index --find-links https://thirdparty.aboutcode.org/pypi --editable .[dev] --editable .[packages] --constraint requirements.txt --constraint requirements-dev.txt
Command '"/workspaces/scancode-toolkit/bin/pip" install --upgrade --no-build-isolation --no-index --find-links https://thirdparty.aboutcode.org/pypi --editable .[dev] --editable .[packages] --constraint requirements.txt --constraint requirements-dev.txt' returned non-zero exit status 1.
[142841 ms] postStartCommand failed with exit code 1. Skipping any further user-provided commands.

&& rm -rf /var/lib/apt/lists/*

# Install common python tools for development
RUN pip install \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need all of these? The minimal set of development tools in use are otherwise included in the [tests]extra and installed with ./configure --dev

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do if we are still relying on PIP as considering some packages will need to handle python wheel buildings.
As i heard you are working on an pip-less env, maybe this is not needed anymore

Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gentle ping.. I would like to merge this and there are a few pending nit pickings for your consideration!

"dockerfile": "Dockerfile",
},
"settings": {
"puppet.installType": "pdk",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is puppet part of the environment?

@pombredanne
Copy link
Member

I tried, but then this happens, even if i go up to python 3.8. The repos on aboutcode are somehow not behaving properly:

This should be fixed now with the 31.x release.

"editor.formatOnSave": true,
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these specific to a developer's local setup?

@pombredanne pombredanne added this to the v32.1 milestone Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants