@nxlv/python
Advanced tools
Comparing version 16.1.0 to 16.1.1
@@ -0,1 +1,7 @@ | ||
# [16.1.0](https://github.com/lucasvieirasilva/nx-plugins/compare/nx-python-v16.0.0...nx-python-v16.1.0) (2023-07-03) | ||
### Features | ||
- **nx-python:** automatically activate shared virtual environment ([#138](https://github.com/lucasvieirasilva/nx-plugins/issues/138)) ([e275534](https://github.com/lucasvieirasilva/nx-plugins/commit/e275534a84ec14652b47ca8942a5cec55248282a)), closes [#132](https://github.com/lucasvieirasilva/nx-plugins/issues/132) | ||
# [16.0.0](https://github.com/lucasvieirasilva/nx-plugins/compare/nx-python-v15.11.0...nx-python-v16.0.0) (2023-06-18) | ||
@@ -2,0 +8,0 @@ |
{ | ||
"name": "@nxlv/python", | ||
"description": "Custom NX Plugin to support the Python language", | ||
"version": "16.1.0", | ||
"version": "16.1.1", | ||
"main": "src/index.js", | ||
@@ -6,0 +6,0 @@ "generators": "./generators.json", |
@@ -51,3 +51,9 @@ "use strict"; | ||
} | ||
return Object.assign(Object.assign(Object.assign({}, options), newOptions), { devDependenciesProject: options.devDependenciesProject || '', individualPackage: !tree.exists('pyproject.toml'), pythonAddopts, | ||
let devDependenciesProjectPkgName; | ||
if (options.devDependenciesProject) { | ||
const { pyprojectToml } = getPyprojectTomlByProjectName(tree, options.devDependenciesProject); | ||
devDependenciesProjectPkgName = pyprojectToml.tool.poetry.name; | ||
} | ||
return Object.assign(Object.assign(Object.assign({}, options), newOptions), { devDependenciesProject: options.devDependenciesProject || '', individualPackage: !tree.exists('pyproject.toml'), devDependenciesProjectPkgName, | ||
pythonAddopts, | ||
projectName, | ||
@@ -128,12 +134,16 @@ projectRoot, | ||
if (normalizedOptions.devDependenciesProject) { | ||
const projectConfig = (0, devkit_1.readProjectConfiguration)(host, normalizedOptions.devDependenciesProject); | ||
const devDepsPyprojectTomlPath = path.join(projectConfig.root, 'pyproject.toml'); | ||
const devDepsPyprojectToml = (0, toml_1.parse)(host.read(devDepsPyprojectTomlPath, 'utf-8')); | ||
const { changed, dependencies } = addTestDependencies(devDepsPyprojectToml.tool.poetry.dependencies, normalizedOptions); | ||
const { pyprojectToml, pyprojectTomlPath } = getPyprojectTomlByProjectName(host, normalizedOptions.devDependenciesProject); | ||
const { changed, dependencies } = addTestDependencies(pyprojectToml.tool.poetry.dependencies, normalizedOptions); | ||
if (changed) { | ||
devDepsPyprojectToml.tool.poetry.dependencies = Object.assign(Object.assign({}, devDepsPyprojectToml.tool.poetry.dependencies), dependencies); | ||
host.write(devDepsPyprojectTomlPath, (0, toml_1.stringify)(devDepsPyprojectToml)); | ||
pyprojectToml.tool.poetry.dependencies = Object.assign(Object.assign({}, pyprojectToml.tool.poetry.dependencies), dependencies); | ||
host.write(pyprojectTomlPath, (0, toml_1.stringify)(pyprojectToml)); | ||
} | ||
} | ||
} | ||
function getPyprojectTomlByProjectName(host, projectName) { | ||
const projectConfig = (0, devkit_1.readProjectConfiguration)(host, projectName); | ||
const pyprojectTomlPath = path.join(projectConfig.root, 'pyproject.toml'); | ||
const pyprojectToml = (0, toml_1.parse)(host.read(pyprojectTomlPath, 'utf-8')); | ||
return { pyprojectToml, pyprojectTomlPath }; | ||
} | ||
function addTestDependencies(dependencies, normalizedOptions) { | ||
@@ -140,0 +150,0 @@ const originalDependencies = lodash_1.default.clone(dependencies); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
313188
2728