python-package-folder 4.3.0__tar.gz → 4.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/PKG-INFO +1 -1
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/pyproject.toml +1 -1
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/python_package_folder/scripts/get-next-version.cjs +120 -27
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/.copier-answers.yml +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/.cursor/plans/optional_version_+_semantic-release_efed88a6.plan.md +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/.cursor/rules/general.mdc +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/.cursor/rules/python.mdc +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/.github/workflows/ci.yml +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/.github/workflows/publish.yml +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/.gitignore +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/.vscode/settings.json +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/LICENSE +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/MANIFEST.in +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/Makefile +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/README.md +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/coverage.svg +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/development.md +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/installation.md +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/publishing.md +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/scripts/get-next-version.cjs +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/__init__.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/__main__.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/_hatch_build.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/analyzer.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/finder.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/manager.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/publisher.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/py.typed +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/python_package_folder.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/subfolder_build.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/types.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/utils.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/version.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/conftest.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/folder_structure/some_globals.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/folder_structure/subfolder_to_build/README.md +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/folder_structure/subfolder_to_build/__init__.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/folder_structure/subfolder_to_build/some_function.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/folder_structure/subfolder_to_build/some_globals.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/folder_structure/utility_folder/_SS/some_superseded_file.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/folder_structure/utility_folder/some_utility.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/test_build_with_external_deps.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/test_linting.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/test_preserve_directory_structure.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/test_publisher.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/test_shared_subdirectory_imports.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/test_spreadsheet_creation_imports.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/test_subfolder_build.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/test_third_party_dependencies.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/test_utils.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/test_version_manager.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/tests.py +0 -0
- {python_package_folder-4.3.0 → python_package_folder-4.3.2}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-package-folder
|
|
3
|
-
Version: 4.3.
|
|
3
|
+
Version: 4.3.2
|
|
4
4
|
Summary: Python package to automatically package and build a folder, fetching all relevant dependencies.
|
|
5
5
|
Project-URL: Repository, https://github.com/alelom/python-package-folder
|
|
6
6
|
Author-email: Alessio Lombardi <work@alelom.com>
|
|
@@ -26,6 +26,7 @@ const path = require('path');
|
|
|
26
26
|
const fs = require('fs');
|
|
27
27
|
const https = require('https');
|
|
28
28
|
const http = require('http');
|
|
29
|
+
const { execSync } = require('child_process');
|
|
29
30
|
|
|
30
31
|
// Parse command line arguments
|
|
31
32
|
const args = process.argv.slice(2);
|
|
@@ -310,48 +311,140 @@ async function queryRegistryVersion(packageName, repository, repositoryUrl) {
|
|
|
310
311
|
return null;
|
|
311
312
|
}
|
|
312
313
|
|
|
313
|
-
|
|
314
|
-
|
|
314
|
+
/**
|
|
315
|
+
* Get global npm prefix for module resolution.
|
|
316
|
+
* This helps find globally installed npm packages.
|
|
317
|
+
* @returns {string[]} Array of possible global node_modules paths
|
|
318
|
+
*/
|
|
319
|
+
function getGlobalNpmPaths() {
|
|
320
|
+
const paths = [];
|
|
321
|
+
|
|
315
322
|
try {
|
|
316
|
-
//
|
|
317
|
-
|
|
318
|
-
|
|
323
|
+
// Get npm's global prefix (where global packages are installed)
|
|
324
|
+
const prefix = execSync('npm config get prefix', { encoding: 'utf8' }).trim();
|
|
325
|
+
|
|
326
|
+
// Global node_modules is typically at <prefix>/lib/node_modules (Linux/Mac)
|
|
327
|
+
const globalNodeModules = path.join(prefix, 'lib', 'node_modules');
|
|
328
|
+
if (fs.existsSync(globalNodeModules)) {
|
|
329
|
+
paths.push(globalNodeModules);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// Alternative location on some systems
|
|
333
|
+
const altGlobalNodeModules = path.join(prefix, 'node_modules');
|
|
334
|
+
if (fs.existsSync(altGlobalNodeModules)) {
|
|
335
|
+
paths.push(altGlobalNodeModules);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
// Also try the prefix itself (some npm configurations)
|
|
339
|
+
if (fs.existsSync(prefix)) {
|
|
340
|
+
paths.push(prefix);
|
|
341
|
+
}
|
|
342
|
+
} catch (e) {
|
|
343
|
+
// If npm config fails, continue with other methods
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
// Try npm root -g to get global node_modules directly
|
|
319
347
|
try {
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
348
|
+
const npmRoot = execSync('npm root -g', { encoding: 'utf8' }).trim();
|
|
349
|
+
if (fs.existsSync(npmRoot) && !paths.includes(npmRoot)) {
|
|
350
|
+
paths.push(npmRoot);
|
|
351
|
+
}
|
|
352
|
+
} catch (e) {
|
|
353
|
+
// Ignore errors
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// Check NODE_PATH environment variable
|
|
357
|
+
if (process.env.NODE_PATH) {
|
|
358
|
+
const nodePaths = process.env.NODE_PATH.split(path.delimiter);
|
|
359
|
+
for (const nodePath of nodePaths) {
|
|
360
|
+
if (fs.existsSync(nodePath) && !paths.includes(nodePath)) {
|
|
361
|
+
paths.push(nodePath);
|
|
332
362
|
}
|
|
333
|
-
process.exit(1);
|
|
334
363
|
}
|
|
335
364
|
}
|
|
365
|
+
|
|
366
|
+
return paths;
|
|
367
|
+
}
|
|
336
368
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
369
|
+
// Main execution
|
|
370
|
+
(async () => {
|
|
371
|
+
try {
|
|
372
|
+
// Get global npm paths for module resolution
|
|
373
|
+
const globalNpmPaths = getGlobalNpmPaths();
|
|
374
|
+
const resolvePaths = [projectRoot, ...globalNpmPaths];
|
|
375
|
+
|
|
376
|
+
// Try to require semantic-release
|
|
377
|
+
// First try resolving from project root + global paths, then try global only, then fall back to default
|
|
378
|
+
let semanticRelease;
|
|
341
379
|
try {
|
|
342
|
-
const
|
|
343
|
-
require(
|
|
380
|
+
const semanticReleasePath = require.resolve('semantic-release', { paths: resolvePaths });
|
|
381
|
+
semanticRelease = require(semanticReleasePath);
|
|
344
382
|
} catch (resolveError) {
|
|
345
383
|
try {
|
|
346
|
-
|
|
347
|
-
|
|
384
|
+
// Try with just global paths
|
|
385
|
+
if (globalNpmPaths.length > 0) {
|
|
386
|
+
const semanticReleasePath = require.resolve('semantic-release', { paths: globalNpmPaths });
|
|
387
|
+
semanticRelease = require(semanticReleasePath);
|
|
388
|
+
} else {
|
|
389
|
+
throw resolveError;
|
|
390
|
+
}
|
|
391
|
+
} catch (globalError) {
|
|
392
|
+
try {
|
|
393
|
+
// Final fallback: default require (should work if in NODE_PATH or default locations)
|
|
394
|
+
semanticRelease = require('semantic-release');
|
|
395
|
+
} catch (e) {
|
|
396
|
+
console.error('Error: semantic-release is not installed.');
|
|
397
|
+
console.error('Please install it with: npm install -g semantic-release');
|
|
398
|
+
console.error('Or install it as a devDependency: npm install --save-dev semantic-release');
|
|
399
|
+
if (isSubfolderBuild) {
|
|
400
|
+
console.error('For subfolder builds, also install: npm install -g semantic-release-commit-filter');
|
|
401
|
+
console.error('Or as devDependency: npm install --save-dev semantic-release-commit-filter');
|
|
402
|
+
}
|
|
403
|
+
process.exit(1);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
// For subfolder builds, require semantic-release-commit-filter
|
|
409
|
+
// (required only to verify it's installed; the plugin is used via options.plugins)
|
|
410
|
+
if (isSubfolderBuild) {
|
|
411
|
+
let commitFilterFound = false;
|
|
412
|
+
let lastError = null;
|
|
413
|
+
|
|
414
|
+
// Try resolving from all paths
|
|
415
|
+
for (const tryPath of resolvePaths) {
|
|
416
|
+
try {
|
|
417
|
+
const commitFilterPath = require.resolve('semantic-release-commit-filter', { paths: [tryPath] });
|
|
418
|
+
require(commitFilterPath);
|
|
419
|
+
commitFilterFound = true;
|
|
420
|
+
break;
|
|
421
|
+
} catch (e) {
|
|
422
|
+
lastError = e;
|
|
423
|
+
continue;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// If not found in any path, try default require
|
|
428
|
+
if (!commitFilterFound) {
|
|
429
|
+
try {
|
|
430
|
+
require('semantic-release-commit-filter');
|
|
431
|
+
commitFilterFound = true;
|
|
432
|
+
} catch (e) {
|
|
433
|
+
lastError = e;
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
if (!commitFilterFound) {
|
|
348
438
|
console.error('Error: semantic-release-commit-filter is not installed.');
|
|
349
439
|
console.error('Please install it with: npm install -g semantic-release-commit-filter');
|
|
350
440
|
console.error('Or install it as a devDependency: npm install --save-dev semantic-release-commit-filter');
|
|
441
|
+
console.error(`Debug: Tried resolving from paths: ${resolvePaths.join(', ')}`);
|
|
442
|
+
if (lastError) {
|
|
443
|
+
console.error(`Debug: Last error: ${lastError.message}`);
|
|
444
|
+
}
|
|
351
445
|
process.exit(1);
|
|
352
446
|
}
|
|
353
447
|
}
|
|
354
|
-
}
|
|
355
448
|
|
|
356
449
|
// Query registry for latest version if repository info is provided
|
|
357
450
|
let registryVersion = null;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/__init__.py
RENAMED
|
File without changes
|
{python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/__main__.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/analyzer.py
RENAMED
|
File without changes
|
{python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/finder.py
RENAMED
|
File without changes
|
{python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/manager.py
RENAMED
|
File without changes
|
{python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/publisher.py
RENAMED
|
File without changes
|
{python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/py.typed
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/types.py
RENAMED
|
File without changes
|
{python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/utils.py
RENAMED
|
File without changes
|
{python_package_folder-4.3.0 → python_package_folder-4.3.2}/src/python_package_folder/version.py
RENAMED
|
File without changes
|
|
File without changes
|
{python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/folder_structure/some_globals.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/test_build_with_external_deps.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_package_folder-4.3.0 → python_package_folder-4.3.2}/tests/test_third_party_dependencies.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|