Skip to content

Added utilities and update documentation#1

Merged
bybatkhuu merged 7 commits intomainfrom
dev
Sep 18, 2025
Merged

Added utilities and update documentation#1
bybatkhuu merged 7 commits intomainfrom
dev

Conversation

@bybatkhuu
Copy link
Copy Markdown
Owner

This pull request makes several improvements to the documentation, streamlines installation and testing instructions, and updates the CI/CD workflow for publishing the package. The most important changes are grouped below:

Documentation Restructuring and Cleanup:

  • Removed the blog section and related files from the documentation, including navigation entries and author metadata, to simplify the docs and focus on core package features [1] [2] [3] [4] [5] [6].
  • Updated the features list and introduction in both README.md and docs/README.md to better reflect the utilities provided by the package [1] [2].
  • Simplified the API documentation navigation by switching to a wildcard entry and removing the dedicated MyClass.md file [1] [2].
  • Added new API documentation pages for utility modules (dt, http, io, sanitizer, secure, validator) to improve discoverability and documentation completeness [1] [2] [3] [4] [5] [6].

Installation and Testing Improvements:

  • Updated installation and development instructions in README.md to recommend using pip install .[test] and pip install .[dev] instead of requirements files, and removed references to TestPyPI for standard installation [1] [2] [3].
  • Updated test instructions in both README.md and docs/dev/test.md to use the new extras-based installation method [1] [2].

CI/CD Workflow Updates:

  • Modified the GitHub Actions workflows to use extras (.[test]) for installing test dependencies and updated the publish workflow to use the production PyPI token by default, with the test publish step commented out [1] [2].

Other Documentation and Navigation Updates:

  • Removed the error codes page from the documentation navigation and sitemap to streamline the getting started and development sections [1] [2].

Example and Configuration Cleanup:

  • Removed verbose example code and configuration section from README.md to simplify and focus the documentation.

These changes collectively modernize the documentation, make installation and testing easier, and improve the CI/CD process.

…e operations, and sanitization

- Introduced new regex constants for request IDs and special character validation.
- Implemented datetime utility functions for timezone handling, ISO conversion, and timestamp generation.
- Added synchronous and asynchronous HTTP connectivity checks.
- Created file I/O utilities for directory and file management, including checksum generation.
- Developed sanitization functions for HTML and URL escaping, along with special character sanitization.
- Implemented validation functions for truthy/falsy checks, request ID validation, and special character detection.
- Updated tests to reflect changes in the utility functions and ensure proper initialization.
@bybatkhuu bybatkhuu self-assigned this Sep 18, 2025
@bybatkhuu bybatkhuu added documentation Improvements or additions to documentation cicd major labels Sep 18, 2025
@bybatkhuu bybatkhuu requested a review from Copilot September 18, 2025 03:16
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request restructures the potato_utils package from a template-style single class implementation to a comprehensive utilities library. The changes modernize the package structure, streamline documentation, and update CI/CD workflows.

  • Removes the example MyClass implementation and replaces it with multiple utility modules
  • Updates package metadata to reflect the new utility-focused approach
  • Modernizes installation and testing instructions to use setuptools extras

Reviewed Changes

Copilot reviewed 55 out of 57 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/potato_utils/ Complete restructure from single class to multiple utility modules (dt, http, io, sanitizer, secure, validator)
tests/test_potato_utils.py Simplified test structure removing MyClass-specific tests
pyproject.toml Updated package description and added multiple optional dependencies
requirements/ Restructured dependency files and added new optional dependencies
Documentation files Removed blog section, updated API docs, simplified installation instructions
CI/CD workflows Updated to use production PyPI by default and extras-based dependency installation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread src/potato_utils/io/_sync.py Outdated
logger.debug(_message)

elif warn_mode == WarnEnum.ERROR:
raise OSError(errno.ENOENT, f"'{create_dir}' directory doesn't exist!")
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message references 'create_dir' but should reference 'remove_dir' since this is in the remove_dir function.

Suggested change
raise OSError(errno.ENOENT, f"'{create_dir}' directory doesn't exist!")
raise OSError(errno.ENOENT, f"'{remove_dir}' directory doesn't exist!")

Copilot uses AI. Check for mistakes.
logger.debug(_message)

elif warn_mode == WarnEnum.ERROR:
raise OSError(errno.ENOENT, f"'{remove_dir}' directory doesn't exist!")
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message references 'remove_dir' but should be consistent with the sync version. However, this is correct while the sync version has the bug.

Copilot uses AI. Check for mistakes.
Comment thread src/potato_utils/sanitizer.py Outdated


@validate_call
def espace_url(val: AnyHttpUrl) -> str:
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function name 'espace_url' should be 'escape_url' to match the intended functionality and be consistent with 'escape_html'.

Copilot uses AI. Check for mistakes.
Comment thread src/potato_utils/sanitizer.py Outdated

__all__ = [
"escape_html",
"espace_url",
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The all export should be 'escape_url' instead of 'espace_url' to match the corrected function name.

Copilot uses AI. Check for mistakes.
Comment on lines +11 to +15
class TSUnitEnum(str, Enum):
SECONDS = "SECONDS"
MILLISECONDS = "MILLISECONDS"
MICROSECONDS = "MICROSECONDS"
NANOSECONDS = "NANOSECONDS"
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TSUnitEnum is duplicated in both constants/_enum.py and dt.py. This duplication should be removed by importing TSUnitEnum from constants in dt.py instead of redefining it.

Copilot uses AI. Check for mistakes.
@bybatkhuu bybatkhuu merged commit 6213c76 into main Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cicd documentation Improvements or additions to documentation major

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants