Commit Graph
56 Commits
Author SHA1 Message Date
xixu-me e6f81ab68b Bump version to 1.2.8
CI/CD / test (macos-latest, 3.12) (push) Waiting to run
CI/CD / test (macos-latest, 3.13) (push) Waiting to run
CI/CD / test (ubuntu-latest, 3.12) (push) Waiting to run
CI/CD / test (ubuntu-latest, 3.13) (push) Waiting to run
CI/CD / test (windows-latest, 3.12) (push) Waiting to run
CI/CD / test (windows-latest, 3.13) (push) Waiting to run
Update the package version from 1.2.7 to 1.2.8 in preparation for a new release.
2025-06-15 16:22:19 +08:00
xixu-me 0a827ec260 Normalize archive path in CLI output
Introduces a helper to ensure the archive path shown in CLI output matches the final file created, mirroring the extension logic from core.py. This improves user clarity by displaying the correct archive filename before and after creation.
2025-06-15 15:17:10 +08:00
xixu-me 3645979315 Bump version to 1.2.7
CI/CD / test (macos-latest, 3.12) (push) Waiting to run
CI/CD / test (macos-latest, 3.13) (push) Waiting to run
CI/CD / test (ubuntu-latest, 3.12) (push) Waiting to run
CI/CD / test (ubuntu-latest, 3.13) (push) Waiting to run
CI/CD / test (windows-latest, 3.12) (push) Waiting to run
CI/CD / test (windows-latest, 3.13) (push) Waiting to run
Update the __version__ variable in __init__.py to 1.2.7 to reflect the new release.
2025-06-10 21:34:16 +08:00
xixu-me 3d85da8267 Add cross-platform file move utility for extraction
Introduced _move_file_cross_platform to handle file moves across drives, especially on Windows where rename may fail. Updated archive extraction logic to use this utility, ensuring robust file operations during extraction and conflict resolution.
2025-06-10 20:04:58 +08:00
xixu-me 4e87976fde Bump version to 1.2.6
Updated the __version__ variable in __init__.py to reflect the new release version 1.2.6.
2025-06-10 18:56:30 +08:00
xixu-me 3fc59f248a Bump version to 1.2.5
Updated the `__version__` in `__init__.py` from 1.2.4 to 1.2.5 to reflect the latest changes or release.
2025-06-09 13:44:27 +08:00
xixu-me 68800be7a9 Bump version to 1.2.4
Updated the __version__ attribute in the __init__.py file to reflect the new version 1.2.4.
2025-06-09 12:20:49 +08:00
xixu-me 305c13119f Improve robustness and clarity in TzstArchive
Refactored error handling, added default behaviors for unknown resolutions, and improved documentation for unsupported modes. Enhanced memory efficiency and compatibility in archive operations, streamlined extraction logic, and validated compression levels more effectively.
2025-06-09 11:14:01 +08:00
xixu-me efbcbbce99 Improve error handling and path validation
Updated compression level validation to use a fallback max level if the zstandard constant is unavailable. Added checks to ensure paths are not None before file operations in the extract_archive function, improving robustness and preventing potential errors.
2025-06-09 10:51:20 +08:00
xixu-me 320ed0a27a Improve robustness in TzstArchive handling
Enhanced error handling and validation in TzstArchive methods, including better checks for file object initialization and compressed stream creation. Updated compression level validation to use dynamic max level from zstd library. Simplified and clarified comments and error messages for unsupported modes and extraction operations.
2025-06-09 10:41:09 +08:00
xixu-me 9b9ad446c1 Update docs and remove CLI interactive option
Updated the Sphinx configuration to set 'includehidden' to False and revised the documentation index to streamline content. Removed the '--interactive' option from CLI commands 'extract' and 'extract_flat' as it is no longer supported.
2025-06-06 20:27:47 +08:00
xixu-me d0e09347eb Update documentation URL in CLI script
Replaced the outdated GitHub README URL with the new documentation URL (https://tzst.xi-xu.me) in the CLI script for better reference.
2025-06-06 16:23:25 +08:00
xixu-me f866f30b7e Bump version to 1.2.3
CI/CD / test (macos-latest, 3.12) (push) Waiting to run
CI/CD / test (macos-latest, 3.13) (push) Waiting to run
CI/CD / test (ubuntu-latest, 3.12) (push) Waiting to run
CI/CD / test (ubuntu-latest, 3.13) (push) Waiting to run
CI/CD / test (windows-latest, 3.12) (push) Waiting to run
CI/CD / test (windows-latest, 3.13) (push) Waiting to run
Updated the `__version__` in `__init__.py` from 1.2.2 to 1.2.3 to reflect the latest changes or release.
2025-06-04 21:39:18 +08:00
xixu-me eb4d29e503 Bump version to 1.2.2
Updated the `__version__` in `__init__.py` from 1.2.1 to 1.2.2 to reflect the latest changes or release.
2025-06-04 21:27:09 +08:00
xixu-me 8035a77c10 Bump version to 1.2.1
Updated the `__version__` in `__init__.py` from 1.2.0 to 1.2.1 to reflect the latest changes or release.
2025-06-04 21:18:57 +08:00
xixu-me 637f1d2562 Update CI workflow and add main entry point
Modified the CI workflow to correctly specify the path to the main script for PyInstaller builds. Added a new standalone entry point in src/main.py to serve as the executable script for tzst.
2025-06-04 21:08:33 +08:00
xixu-me 7d688d420b Bump version to 1.2.0
Updated the `__version__` in `__init__.py` to reflect the new release version 1.2.0.
2025-06-04 20:54:49 +08:00
xixu-me 6397968a4d Improve conflict resolution in archive extraction
Updated the `extract_archive` function to handle string-based conflict resolution by converting it to an enum. Added fallback to `ConflictResolution.REPLACE` for invalid values, ensuring safer and more predictable behavior.
2025-06-04 19:27:41 +08:00
xixu-me cb5c198d16 Refactor tests and enhance coverage for conflict resolution and edge cases
- Removed outdated tests for missing lines in core.py.
- Added comprehensive tests for conflict resolution functionality, including various resolution strategies and edge cases.
- Improved error handling tests for archive creation and extraction processes.
- Enhanced unit tests for basic functionality and convenience functions with pytest markers.
- Introduced tests for unique filename generation and conflict handling scenarios.
- Added edge case tests for archive extraction and error conditions to improve overall test coverage.
2025-06-04 18:55:53 +08:00
xixu-me e65a56c00b Bump version to 1.1.1
Updated the library version in __init__.py from 1.1.0 to 1.1.1 to reflect the latest changes or improvements.
2025-06-02 22:00:49 +08:00
xixu-me 172ec6cb29 Add validation for invalid commands in CLI
Introduced `_validate_command_in_argv` to check for invalid commands in CLI arguments. Updated compression level validation to include the new `-c` flag. Adjusted tests to reflect changes in error handling, ensuring argparse error codes are maintained for invalid inputs.
2025-06-02 20:11:15 +08:00
xixu-me 94b7a5b31a Add error handling and extractall method in TzstArchive
Enhanced the TzstArchive class with improved error handling for cleanup and file addition operations. Introduced a new extractall method with filtering options for secure extraction. Updated tests to reflect changes in extraction behavior and error handling.
2025-06-02 19:43:50 +08:00
xixu-me aef5d90a3a Handle KeyboardInterrupt in CLI commands
Added handling for KeyboardInterrupt in `cmd_list` and `cmd_test` functions to gracefully terminate operations and return exit code 130 when interrupted by the user.
2025-06-02 15:54:00 +08:00
xixu-me 8aa893827b Add type casting and improve extraction logic
Introduced type casting with `Literal` in CLI extraction commands to ensure stricter type safety for filter arguments. Updated extraction logic in `core.py` to differentiate parameters for `extract` and `extractall` methods, improving compatibility and handling of attributes during extraction.
2025-06-02 15:22:13 +08:00
xixu-me 35df0a4a44 Update project description and docstring
Revised the project description in pyproject.toml and the module docstring in src/tzst/__init__.py to reflect the library's focus on modern archive management and Zstandard compression.
2025-06-02 06:48:46 +08:00
xixu-me 4e0ec638cc Add handling for extreme compression levels
Introduced `_is_extreme_compression_level_in_argv` to detect extreme compression levels (>=1000) and updated `_handle_parsing_errors` to return exit code 1 for such cases. Adjusted related tests to validate the new behavior and fixed inconsistencies in test assertions for compression level and filter validation.
2025-06-02 06:29:33 +08:00
xixu-me 028bb3f1b9 Add version command handler
Introduced a `cmd_version` function to handle the `--version` flag, replacing the previous implementation that used `argparse`'s `action='version'`. Updated the argument parser and command execution logic to support the new version handling.
2025-06-02 02:31:02 +08:00
xixu-me 86582c9d49 Bump library version to 1.1.0
Updated the `__version__` in `__init__.py` to reflect the new version of the tzst library, indicating changes or improvements in the library.
2025-06-02 01:20:37 +08:00
xixu-me ed4ac6c9fb Add issue templates for feature requests, performance issues, platform-specific issues, questions, and security vulnerabilities
- Created detailed YAML templates for various issue types to streamline user submissions and improve issue tracking.
- Added a comprehensive pull request template to guide contributors in providing necessary information.
- Developed a contributing guide to outline project setup, contribution types, testing procedures, and code style guidelines.
2025-06-02 00:25:49 +08:00
xixu-me 17c530ef21 Fix current directory archiving logic
Updated `_create_archive_impl` to handle current directory archiving more robustly, including resolving paths, excluding temporary files, and ensuring the archive file itself is excluded. Added comprehensive tests to verify behavior for edge cases and temporary file exclusion patterns.
2025-06-01 23:19:09 +08:00
xixu-me 22dc90259b Add version argument and update tests
Introduced a '--version' argument in the CLI to display version information. Updated test cases to reflect changes in compression level validation and error codes. Adjusted special character handling in test_core.py and added integration test markers in pyproject.toml.
2025-06-01 18:37:27 +08:00
xixu-me 97243e6a27 Refactor CLI archive creation logic
Refactored the archive creation workflow in `cli.py` to improve modularity and error handling. Added helper functions for file validation, argument parsing, and exception handling. Removed `test_fixes.py` as it is no longer relevant to the updated CLI structure.
2025-06-01 17:45:59 +08:00
xixu-me dc12d122c4 Improve CLI error handling and add tests
Enhanced error handling in `cli.py` for invalid compression levels, filters, and file path issues. Added `test_fixes.py` to verify CLI behavior, including tests for help output, invalid arguments, and edge cases.
2025-06-01 17:28:59 +08:00
xixu-me 6693713143 Fix exception chaining in compression validation
Updated the `validate_compression_level` function to suppress exception chaining when raising `argparse.ArgumentTypeError`. This improves error clarity by removing unnecessary context from the original `ValueError`.
2025-06-01 17:06:47 +08:00
xixu-me 459b695af0 Add compression level validation to CLI
Introduced a `validate_compression_level` function to ensure compression levels are within the valid range (1-22). Updated CLI argument parsing to use this validation and added tests to verify valid, invalid, and non-numeric compression levels.
2025-06-01 17:01:27 +08:00
xixu-me acd9ced29e Fixes critical path resolution bug and consolidates tests
Resolves a critical bug in non-atomic archive creation where relative
archive paths failed when the working directory changed during operation.
The fix converts archive paths to absolute before changing directories.

Consolidates duplicate CLI and security tests into comprehensive test
suites to eliminate redundancy and improve maintainability. Adds
extensive edge case coverage including platform-specific features,
Unicode handling, and performance scenarios.

Updates version to 1.0.1 and ensures proper exit code propagation
in the main entry point for better script integration.
2025-06-01 14:57:31 +08:00
xixu-me 07ea3092e0 Improve archive creation for current directory
Updated `_create_archive_impl` to handle the current directory (".") more effectively by adding its contents without the "./" prefix. Also normalized path separators and improved handling of relative paths in the archive.
2025-06-01 03:26:21 +08:00
xixu-me 003ade93d3 Remove line breaks in CLI help text
Updated the CLI help text in `cli.py` to remove unnecessary line breaks for better readability and consistency in the command reference and argument descriptions.
2025-06-01 02:34:36 +08:00
xixu-me 7deb6f335d Bump version to 1.0.0
Updated the library version from 0.4.0 to 1.0.0 in __init__.py to reflect a major release.
2025-06-01 02:20:31 +08:00
xixu-me 40eae4df14 Refactor archive listing logic
Extracted verbose and simple archive listing logic into separate helper functions `_print_verbose_listing` and `_print_simple_listing` to improve code readability and maintainability in `cmd_list`.
2025-06-01 00:45:27 +08:00
xixu-me afc20b794c Enhance documentation and update config
Updated `pyproject.toml` to include additional Ruff configuration options and improved linting rules. Enhanced docstrings in `cli.py` and `core.py` with `See Also` references for better code navigation and understanding.
2025-06-01 00:27:54 +08:00
xixu-me 6cc8f28175 Refactor CLI and update CI workflow
Updated the CI workflow to use 'ruff format' instead of 'black' for format checks. Enhanced docstrings across CLI commands and exception classes for better clarity and documentation. Adjusted pyproject.toml to remove 'black' from dev dependencies and added new files to sdist include list.
2025-05-31 22:49:41 +08:00
xixu-me 4a0ff4c500 Refine error messages and remove Python 3.14 fix
Updated error messages in `cli.py` for consistency and clarity by replacing colons with dashes. Removed compatibility fix for Python 3.14 in `core.py` as it is no longer needed.
2025-05-31 18:48:02 +08:00
xixu-me bca4bfaea8 Update dependencies and remove compatibility fix
Updated the zstandard dependency version in pyproject.toml to allow versions starting from 0.23.0. Removed a compatibility fix for Python 3.14 in src/tzst/__init__.py as it is no longer needed.
2025-05-31 17:15:19 +08:00
xixu-me adee9dbdd5 Update zstandard dependency and add Python 3.14 fix
Updated the zstandard dependency to version 0.23.1 in README.md and pyproject.toml. Added a compatibility fix in src/tzst/core.py for Python 3.14 due to the removal of ByteString from the typing module.
2025-05-31 17:10:45 +08:00
xixu-me e6af81c3ac Fix Python 3.14 compatibility issue
Removed unnecessary version check and simplified compatibility fix for Python 3.14 by directly importing ByteString from collections.abc and assigning it to typing.ByteString.
2025-05-31 16:59:01 +08:00
xixu-me 7c36b7ac34 Update zstandard dependency and add Python 3.14 fix
Updated the zstandard dependency to version 0.23.0 in README.md and pyproject.toml. Added a compatibility fix in src/tzst/__init__.py for Python 3.14 due to the removal of ByteString from typing.
2025-05-31 16:54:01 +08:00
xixu-me 6b57409712 Update Python version support to 3.12+
This commit updates the CI configuration, pyproject.toml, and codebase to drop support for Python versions below 3.12 and add support for Python 3.13. Type hints are updated to use modern syntax, and redundant checks for extraction filter support are removed as Python 3.12+ always supports filters.
2025-05-31 15:48:13 +08:00
xixu-me 5de5036bba Remove backward compatibility for Python < 3.12
Dropped custom extraction filter implementations and related exception classes for older Python versions in `core.py`. Updated README to reflect the new minimum Python version requirement (3.12) and removed outdated support section.
2025-05-31 01:39:56 +08:00
xixu-me e81ac01161 Add security filters for archive extraction
Introduced security filters for extracting `.tzst` archives, including backward compatibility for Python < 3.12. Updated README with documentation on filter usage and added implementation for 'data', 'tar', and 'fully_trusted' filters in `core.py`. Bumped version to 0.4.0 in `__init__.py`.
2025-05-31 00:51:18 +08:00