Commit Graph
88 Commits
Author SHA1 Message Date
xixu-me 76963aaf9f Fix indentation in CI workflow script
Corrected the indentation in the Python script within the CI workflow to ensure proper execution of the version assignment and file writing logic.
2025-06-04 21:26:38 +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 d95f173308 Update PyInstaller command in CI workflow
Modified the PyInstaller command in the CI configuration to specify 'src/main.py' as the entry point for building binaries across macOS, Windows, and Linux ARM64 platforms.
2025-06-04 21:12:43 +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 d2f11636be Revert "Add standalone entry point for tzst"
This reverts commit 69918b4be5.
2025-06-04 21:05:15 +08:00
xixu-me 69918b4be5 Add standalone entry point for tzst
Created a new main.py file as the standalone entry point for tzst, intended for PyInstaller builds. This script sets up the Python path and invokes the CLI main function.
2025-06-04 21:04:24 +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 56a10bc038 Update CI workflow for macOS and binary verification
This commit updates the CI workflow to use macOS-14 for ARM-based runners, adds binary verification steps for Linux, macOS, and Windows, and improves release asset upload handling with success checks. Additionally, it refines the README badge update process for PyPI version.
2025-06-04 20:54:31 +08:00
xixu-me 1dd3cde654 Enhance CI/CD workflow for versioned tags
Updated the CI/CD pipeline to support versioned tags for releases. Added new jobs for building binaries across multiple platforms and architectures, creating release assets, and uploading them to GitHub. Improved conditional logic for triggering workflows based on tags and streamlined badge updates.
2025-06-04 20:42:48 +08:00
xixu-me a1de2e1855 Remove unused report configuration in Codecov
The 'report.exclude_labels' section was removed from the Codecov configuration as it is no longer needed. This simplifies the configuration file.
2025-06-04 20:06:18 +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 afe5d738a6 Merge pull request #5 from xixu-me/alert-autofix-5
Potential fix for code scanning alert no. 5: Workflow does not contain permissions
2025-06-02 22:02:55 +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-meandCopilot Autofix powered by AI 06eac113fa Potential fix for code scanning alert no. 5: Workflow does not contain permissions
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-06-02 21:46:34 +08:00
xixu-me d300760799 Remove references to changelog and delete file
Removed all references to `CHANGELOG.md` in documentation and templates, and deleted the `docs/changelog.md` file. This change reflects a shift away from maintaining a changelog in favor of other documentation practices.
2025-06-02 21:39:24 +08:00
xixu-me a5f342f556 Final documentation cleanup and refinements 2025-06-02 21:26:20 +08:00
xixu-me cfb8290dea Add comprehensive Sphinx documentation with GitHub Pages deployment
- Complete documentation structure with index, quickstart, examples, and API reference
- Sphinx configuration with RTD theme, MyST parser, and autodoc
- GitHub Actions workflow for automated documentation building and deployment
- Local development tools (Makefile, build scripts)
- Comprehensive examples covering basic usage, security, and performance
- API documentation for core, CLI, and exceptions modules
2025-06-02 21:11:45 +08:00
xixu-me 654d9f1666 Improve cleanup and exception handling in tests
Enhanced cleanup logic in `temp_dir` fixture to handle Windows-specific file locking issues. Updated tests to ensure suppressed exceptions during context manager exit and added manual cleanup for mocked objects to prevent resource leaks.
2025-06-02 20:23:09 +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 1d98650d3b Refactor test cases for clarity and consistency
Updated test cases in `test_cli_missing_lines.py`, `test_core_missing_lines.py`, and `test_core_missing_lines_fixed.py` to improve readability and consistency. Changes include replacing redundant comments, simplifying code structure, and ensuring proper function usage (e.g., `_validate_files` instead of `validate_files`).
2025-06-02 17:09:03 +08:00
xixu-me 1cad021539 Add comprehensive test cases for CLI and core
Introduced new test files to improve coverage for CLI and core functionalities. Added edge case tests for CLI commands, conftest fixtures, and core archive handling, including error handling, streaming mode, and verbose listing.
2025-06-02 16:39:04 +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 0ecbdb3ea0 Add tests for edge cases and coverage improvements
Introduced new test cases in `test_convenience_functions.py` and `test_security_and_errors.py` to cover edge cases, improve code coverage, and validate specific scenarios such as invalid modes, compression levels, and operations on closed archives. These changes address missing lines from the coverage report and enhance robustness.
2025-06-02 07:54:27 +08:00
xixu-me a4ddd106f8 Add comprehensive CLI test coverage
Introduced new test cases for CLI commands to cover verbose and simple listing functionalities, exception handling, and edge cases. This includes tests for missing files, decompression errors, keyboard interrupts, and advanced scenarios to ensure robust behavior.
2025-06-02 07:14:17 +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 da2baa46c5 Add integration and unit tests for tzst library functionality
- Created integration tests for complex scenarios in `tests/integration/test_complex_scenarios.py`.
- Added unit tests for core functionality, convenience functions, security features, and error handling in `tests/unit/test_archive_basics.py`, `tests/unit/test_convenience_functions.py`, `tests/unit/test_security_and_errors.py`.
- Implemented tests for temporary file exclusion, large file operations, and complex directory structures.
- Included tests for atomic operations and compression level validation.
- Established a structure for integration and unit tests with appropriate docstrings and assertions.
2025-06-02 05:40:42 +08:00
xixu-me b1c165f473 Update repository URL in CONTRIBUTING.md
The repository URL in the CONTRIBUTING.md file was updated to reflect the correct GitHub username 'xixu-me' instead of 'your-username'.
2025-06-02 02:51:20 +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 44c8b20e9f Update repository URL in README
The repository URL in the README was updated to reflect the correct GitHub username, changing from 'your-username' to 'xixu-me'.
2025-06-02 01:08:28 +08:00
xixu-me b83d320afc Update CI workflow to ignore specific paths
Modified the CI/CD workflow to ignore changes to markdown files, LICENSE, documentation, and .gitignore files for push and pull request events. This helps optimize the workflow by skipping unnecessary builds.
2025-06-02 01:05:46 +08:00
xixu-me de7d3d735e Update README for clarity and consistency
Improved phrasing and formatting in the README to enhance clarity and consistency. Removed redundant sections, streamlined explanations, and updated examples for better readability and usability.
2025-06-02 00:54:42 +08:00
xixu-me 260ba1f66e Fix README link in question issue template
Updated the relative path to the README.md file in the question issue template to ensure the link resolves correctly.
2025-06-02 00:32:42 +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 0216fcc128 Update README with enhanced library description
Revised the README to include a more detailed and professional description of the **tzst** library, highlighting its features, performance, and compatibility with Python 3.12+.
2025-06-01 23:41:21 +08:00
xixu-me 8cfc1308d6 Merge pull request #4 from xixu-me/alert-autofix-2
Potential fix for code scanning alert no. 2: Workflow does not contain permissions
2025-06-01 23:23:53 +08:00
xixu-meandCopilot Autofix powered by AI 8e41740e0f Potential fix for code scanning alert no. 2: Workflow does not contain permissions
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2025-06-01 23:22:21 +08:00
xixu-me 4b59c6cad5 Merge pull request #3 from xixu-me/dependabot/github_actions/stefanzweifel/git-auto-commit-action-5
Bump stefanzweifel/git-auto-commit-action from 4 to 5
2025-06-01 23:20:03 +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 3d99d7a6db Add Codecov integration and update CI workflow
Introduced a .codecov.yml file to configure Codecov settings, updated the CI workflow to include Codecov token and slug, added a Codecov badge to README.md, and adjusted coverage options in pyproject.toml for improved reporting.
2025-06-01 20:03:53 +08:00
xixu-me d2095bb7b4 Fix path in no_atomic extraction test
Updated the test to correctly reference the extracted file path in the 'test_no_atomic_extracted' scenario, ensuring the test checks the correct file location.
2025-06-01 19:07:14 +08:00
xixu-me ec04f2935e Add tests for invalid compression levels
Introduced a new test case to verify that invalid compression levels return proper error codes. Minor formatting adjustments were also made to improve code readability.
2025-06-01 18:49:35 +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 2a3ccefb21 Refactor CLI tests to use unpacking for file lists
Updated test cases in `test_cli.py` and `test_platform_specific.py` to use argument unpacking (`*files`) for file lists passed to the `main` function. This improves readability and consistency across test cases.
2025-06-01 15:13:56 +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 79d204fc92 Merge pull request #2 from xixu-me/dependabot/github_actions/codecov/codecov-action-5
Bump codecov/codecov-action from 3 to 5
2025-06-01 11:51:58 +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 48fb66a957 Update README with --no-atomic option
Added documentation for the '--no-atomic' option in the 'create' command, including its usage and a note that it is not recommended. This improves clarity for users regarding atomic file operations.
2025-06-01 01:02:44 +08:00
xixu-me 841b8973bd Update CI script to use GITHUB_OUTPUT
Modified the CI workflow to write the version output to the GITHUB_OUTPUT file instead of using the deprecated 'set-output' command. Added 'os' module import to support this change.
2025-06-01 00:55:16 +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 f2d8e6ad03 Refactor CLI command argument handling in tests
Updated test cases to use unpacking syntax (*file_paths) for passing file paths to CLI commands. This improves readability and ensures consistent argument handling across all test scenarios.
2025-06-01 00:37:25 +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 9b411a3f28 Update zstandard dependency version
Lowered the minimum required version of the zstandard dependency from 0.23.0 to 0.19.0 in pyproject.toml to improve compatibility.
2025-05-31 17:43:06 +08:00
xixu-me af2659facf Update Python version support and dependencies
Removed support for Python 3.14 pre-release across CI workflows, README, and pyproject.toml. Updated zstandard dependency version in README and adjusted Ruff target version to Python 3.12.
2025-05-31 17:22:03 +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 aa39f7641d Add support for Python 3.14
Updated CI workflows to include Python 3.14 with pre-release support. Modified README and pyproject.toml to reflect compatibility with Python 3.14. Adjusted ruff target version to Python 3.14.
2025-05-31 16:41:15 +08:00
xixu-me c53637aaf7 Add strict mode to zip iteration in tests
Updated tests in `test_core.py` to use the `strict=True` parameter in `zip` for better error handling when iterating over buffered and streaming contents. This ensures mismatched lengths are caught during testing.
2025-05-31 15:53:56 +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 4e155d0e05 Refactor test argument order in CLI security tests
Reordered arguments in the test_filter_with_other_options method for better readability and consistency. This change improves clarity in the test setup.
2025-05-31 01:01:24 +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
xixu-me 4c4235ee87 Add security filters for archive extraction
Introduced security filters ('data', 'tar', 'fully_trusted') to enhance safety during archive extraction. Updated CLI commands, core extraction logic, and added comprehensive tests to ensure proper handling of filters and security warnings.
2025-05-31 00:12:39 +08:00
xixu-me 1fb4782009 Add streaming and no-atomic options to CLI
Updated the CLI to support a `--streaming` option for memory-efficient operations and a `--no-atomic` option to disable atomic file operations. Adjusted related functions to handle these new arguments and updated the documentation accordingly. Also bumped the library version to 0.3.1.
2025-05-30 15:52:00 +08:00
xixu-me 34263a2265 Update project status to stable in pyproject.toml
Changed the 'Development Status' classifier from 'Beta' to 'Production/Stable' to reflect the project's maturity.
2025-05-30 15:02:39 +08:00
xixu-me 9c4cf715d4 Update README with streaming mode details
Enhanced the README to include detailed information about streaming mode for large archives, atomic file operations, and improved error handling. Added examples, CLI options, and Python API usage for memory-efficient processing and recovery mechanisms.
2025-05-30 14:47:52 +08:00
xixu-me 521a6858fb Add streaming mode and atomic operations
Introduced streaming mode for memory-efficient handling of large archives and added atomic file operations for reliable archive creation. Updated CLI commands, core functionality, and tests to support these features. Improved error handling and documentation for append mode and compression level validation.
2025-05-30 14:22:07 +08:00
xixu-me 56b427caba Update issue templates 2025-05-30 13:30:06 +08:00
xixu-me 4d6efc4402 Update issue templates 2025-05-30 13:18:21 +08:00
xixu-me 12fe2a8d5e Add funding info and update workflows
Added a FUNDING.yml file to specify sponsorship details. Updated the CI workflow to include a new job for updating badges and improved PyPI version handling. Modified README badges and CLI to include a banner print function and adjusted version display.
2025-05-30 12:01:34 +08:00
xixu-me c26273fd79 Update README.md 2025-05-29 22:31:21 +08:00
xixu-me 6d57fc0203 Update __init__.py 2025-05-29 22:15:47 +08:00
xixu-me 66961164a4 Create dependabot.yml 2025-05-29 22:14:36 +08:00
xixu-me 6a3cdd48b8 Initial commit 2025-05-29 21:59:21 +08:00