Skip to content

Commit

Permalink
fix: support for pipenv with python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
gemaxim committed Aug 6, 2024
1 parent d8914fe commit 82c5822
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ commands:
parameters:
items:
type: string
default: go gradle python elixir composer gradle@6 maven sbt dotnet
default: go gradle python pipenv pyenv elixir composer gradle@6 maven sbt dotnet
steps:
- run:
name: Installing Rosetta
Expand Down
62 changes: 14 additions & 48 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"snyk-nuget-plugin": "2.7.2",
"snyk-php-plugin": "1.9.2",
"snyk-policy": "^1.25.0",
"snyk-python-plugin": "2.1.1",
"snyk-python-plugin": "2.2.1",
"snyk-resolve-deps": "4.7.3",
"snyk-sbt-plugin": "2.18.1",
"snyk-swiftpm-plugin": "1.4.1",
Expand Down
12 changes: 12 additions & 0 deletions test/acceptance/workspaces/pipenv-app-python-3.12/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
"Jinja2" = "*"

[dev-packages]

[requires]
python_version = "3.12"
23 changes: 23 additions & 0 deletions test/jest/acceptance/snyk-test/basic-test-all-languages.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,29 @@ describe('`snyk test` of basic projects for each language/ecosystem', () => {
expect(result.stderr).toMatch(wrongPythonCommand);
});

test('run `snyk test` on a pipenv project', async () => {
const project = await createProjectFromWorkspace('pipenv-app');
let pythonCommand = 'python';

await runCommand(pythonCommand, ['--version']).catch(function() {
pythonCommand = 'python3';
});

const pipenvResult = await runCommand('pipenv', ['install'], {
shell: true,
cwd: project.path(),
});

expect(pipenvResult.code).toEqual(0);

const result = await runSnykCLI('test -d --command=' + pythonCommand, {
cwd: project.path(),
env,
});

expect(result.code).toEqual(0);
});

test('run `snyk test` on a gradle project', async () => {
const project = await createProjectFromWorkspace('gradle-app');

Expand Down

0 comments on commit 82c5822

Please sign in to comment.