Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix v0.3.1 #105

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ version: 2
build:
os: "ubuntu-20.04"
tools:
python: "3.9"
python: "3.12"
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Python 3.12 upgrade needs code modifications

The codebase currently uses pre-Python 3.10 syntax for type hints (using Union instead of the | operator) and has a minimum Python requirement of ">=3.9". While upgrading to Python 3.12 is technically possible since it meets the minimum version requirement, the following code patterns should be modernized first:

  • src/undate/undate.py: Uses pre-3.10 Union type hints
  • src/undate/date.py: Uses pre-3.10 Union type hints
  • src/undate/converters/iso8601.py: Has type-related comments suggesting compatibility issues

Consider modernizing the type hints to use Python 3.10+ syntax before upgrading to Python 3.12 to take advantage of newer language features and maintain cleaner code.

🔗 Analysis chain

Verify Python 3.12 compatibility

The Python version has been updated from 3.9 to 3.12, which is a significant version jump. Let's verify the project's compatibility with Python 3.12.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check project's Python version constraints in setup.py or pyproject.toml
fd -e toml -e py -x cat {} \; | rg -i "python.*version|requires-python"

# Check if any dependencies have Python 3.12 compatibility issues
if [ -f "pyproject.toml" ]; then
    cat pyproject.toml | rg "dependencies|requires"
elif [ -f "setup.py" ]; then
    cat setup.py | rg "install_requires|python_requires"
fi

Length of output: 298


Script:

#!/bin/bash
# Check if there are any Python version specific code patterns or features
rg -i "match.*case|type.*param|union.*type|dataclass.*kw_only|tomllib" -A 2

# Check dependencies' Python version requirements
if [ -f "requirements.txt" ]; then
    cat requirements.txt
fi

# Look for any CI configurations that might indicate Python version testing
fd -e yml -e yaml -x cat {} \; | rg -i "python.*version|python-version|matrix.*python"

Length of output: 1208


sphinx:
configuration: docs/conf.py

python:
install:
- requirements: docs/requirements.txt
- method: pip
path: .
extra_requirements:
- docs
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change Log

## 0.3.1

Update readthedocs config for current installation

Comment on lines +5 to +6
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Expand the changelog entry with more details about the configuration changes.

The current entry is too brief. Consider adding specific details about:

  • Python version update to 3.12
  • Changes to dependency installation method
  • Addition of extra_requirements for documentation

This will help users understand the full scope of changes in this hotfix.

Apply this diff to expand the entry:

-Update readthedocs config for current installation
+Update readthedocs configuration:
+- Update Python version to 3.12
+- Change dependency installation to use pip directly from current directory
+- Add extra_requirements for documentation dependencies
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Update readthedocs config for current installation
Update readthedocs configuration:
- Update Python version to 3.12
- Change dependency installation to use pip directly from current directory
- Add extra_requirements for documentation dependencies

## 0.3

- Updated to use numpy `datetime64` to support a greater range of years beyond the 4-digit years supported by python's builtin `datetime.date`
Expand Down
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import undate
Copy link

Choose a reason for hiding this comment

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

bug_fix
The import statement for undate should be checked for correctness. If undate is not a valid module or if it is misspelled, it will lead to an ImportError. Ensure that the module is correctly named and available in the environment.


# -- Project information -----------------------------------------------------

Expand All @@ -22,7 +23,7 @@
author = "DHtech Community"

# The full version, including alpha/beta/rc tags
release = "0.0.1.dev"
release = undate.__version__
Comment on lines 25 to +26
Copy link

Choose a reason for hiding this comment

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

error_handling_issue
The assignment of release to undate.__version__ assumes that undate has a __version__ attribute. If this attribute does not exist, it will raise an AttributeError. Consider adding error handling to manage this case gracefully.


master_doc = "index"

Expand Down
4 changes: 2 additions & 2 deletions src/undate/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__version__ = "0.3.0"
__version__ = "0.3.1"

from undate.date import DatePrecision
from undate.undate import Undate, UndateInterval

__all__ = ["Undate", "UndateInterval", "DatePrecision"]
__all__ = ["Undate", "UndateInterval", "DatePrecision", "__version__"]
Loading