-
Notifications
You must be signed in to change notification settings - Fork 60
Fix python3.8 compatibility #106
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
Open
eric-downes
wants to merge
16
commits into
AndreaCensi:master
Choose a base branch
from
eric-downes:fix-python38-compatibility
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix python3.8 compatibility #106
eric-downes
wants to merge
16
commits into
AndreaCensi:master
from
eric-downes:fix-python38-compatibility
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I believe this addresses #72 |
|
There seems to be an error in
ran this on Python 3.11.2 |
Thanks. I’ll see if I can reproduce locally.On Apr 10, 2025, at 09:47, Ajadaz ***@***.***> wrote:
There seems to be an error in setup.py. Tried installing through pip and got
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\me\AppData\Local\Temp\pip-req-build-98z_4ogz\setup.py", line 71
classifiers=[
^^^^^^^^^^^^^
SyntaxError: keyword argument repeated: classifiers
[end of output]
ran this on Python 3.11.2—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
Ajadaz left a comment (AndreaCensi/contracts#106)
There seems to be an error in setup.py. Tried installing through pip and got
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\me\AppData\Local\Temp\pip-req-build-98z_4ogz\setup.py", line 71
classifiers=[
^^^^^^^^^^^^^
SyntaxError: keyword argument repeated: classifiers
[end of output]
ran this on Python 3.11.2
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Fix python38 compatibility
- Converted yield-style tests to parameterized tests - Updated requirements to remove nose dependency - Added migration guide with patterns and examples - Created migration tracking tools - Fixed Python 3.12 compatibility issues in tests - Updated documentation to mention pytest
- Add lessons learned from the migration process - Include information about test coverage management - Add section on migration tracking and tooling - Add guidance for handling false positives in migration tracking - Provide example code for migration tools
- Add comprehensive test suite for py_compatibility.py - Add tests for utils.py, enabling.py and inspection.py - Improve test coverage from 88% to 90% - Update documentation with Python 3.12+ compatibility notes - Add additional insights to nose-to-pytest migration guide - Clean up migration artifacts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PyContracts Python 3.8+ Compatibility Fixes
This PR adds compatibility with Python 3.8+ by fixing several issues.
The changes are minimal and focused on maintaining compatibility.
inspect.ArgSpec
RemovalIn Python 3.8+,
inspect.ArgSpec
was removed. Fixed by:collections.namedtuple
src/contracts/backported.py
Several NumPy types used in PyContracts were deprecated:
np.int
,np.float
withnp.int64
etcnp.complex
withnp.complex128
src/contracts/library/array_ops.py
Abstract base classes moved from
collections
tocollections.abc
in Python 3.3+:collections.abc
for Container, Iterable, etc. in Python 3.3+collections.Callable
with the built-incallable
functionsrc/contracts/library/miscellaneous_aliases.py
Fixed SyntaxWarnings related to invalid escape sequences in regular expressions:
\s
withr'\s'
; raw strings FTW!src/contracts/docstring_parsing.py
Testing. All functionality tested with Python 3.8+: