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

Update byte-code for Python 3.13 #1095

Merged
merged 18 commits into from
Feb 14, 2025

Conversation

guyer
Copy link
Member

@guyer guyer commented Feb 12, 2025

Fixes #1094

@guyer guyer linked an issue Feb 12, 2025 that may be closed by this pull request
@guyer
Copy link
Member Author

guyer commented Feb 12, 2025

New scipy lockfiles are broken

    Traceback (most recent call last):                                                                                                                          
      File "/Users/guyer/mambaforge-arm/lib/python3.10/site-packages/conda/exception_handler.py", line 18, in __call__                                          
        return func(*args, **kwargs)                                                                                                                            
      File "/Users/guyer/mambaforge-arm/lib/python3.10/site-packages/conda/cli/main.py", line 61, in main_subshell                                              
        exit_code = do_call(args, parser)                                                                                                                       
      File "/Users/guyer/mambaforge-arm/lib/python3.10/site-packages/conda/cli/conda_argparse.py", line 205, in do_call                                         
        result = getattr(module, func_name)(args, parser)                                                                                                       
      File "/Users/guyer/mambaforge-arm/lib/python3.10/site-packages/conda/notices/core.py", line 132, in wrapper                                               
        return func(*args, **kwargs)                                                                                                                            
      File "/Users/guyer/mambaforge-arm/lib/python3.10/site-packages/conda/cli/main_create.py", line 154, in execute                                            
        return install(args, parser, "create")                                                                                                                  
      File "/Users/guyer/mambaforge-arm/lib/python3.10/site-packages/conda/cli/install.py", line 308, in install                                                
        explicit(specs, prefix, verbose=not context.quiet)                                                                                                      
      File "/Users/guyer/mambaforge-arm/lib/python3.10/site-packages/conda/deprecations.py", line 174, in inner                                                 
        return func(*args, **kwargs)                                                                                                                            
      File "/Users/guyer/mambaforge-arm/lib/python3.10/site-packages/conda/misc.py", line 128, in explicit                                                      
        raise AssertionError(                                                                                                                                   
    AssertionError: Missing package cache records for: conda-forge/linux-64::x264==1!164.3095=h166bdaf_2[md5=6c99772d483f566d59e25037fea2c4b1]                  

@guyer guyer requested review from wd15 and tkphd February 13, 2025 19:18
@@ -287,6 +291,11 @@ def _py3kInstructions(self, op, style, argDict, id, freshen):
stack.append(self._unop[ins.opcode] + '(' + stack.pop() + ')')
elif ins.opcode in self._binop:
stack.append(stack.pop(-2) + " " + self._binop[ins.opcode] + " " + stack.pop())
elif ins.opname == 'UNARY_NEGATIVE':
Copy link
Contributor

Choose a reason for hiding this comment

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

A lot of this code is of the form:

 if dis.opname[bytecode] == 'UNARY_CONVERT':
                    stack.append("`" + stack.pop() + "`")

It could be cleaned up by having a dictionary that relates UNARY_CONVERTER to what's inside the stack.append. You would then just have one line of

stack.append(relation_dict.get(disopname[bytecode], otherfunc()))

and use get to call another function for the edge cases.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's grown organically over a bazillion years, but I'll give that a think

@wd15
Copy link
Contributor

wd15 commented Feb 14, 2025

probably want to squash most of these commits

@guyer guyer merged commit 2730380 into master Feb 14, 2025
24 checks passed
@guyer guyer deleted the 1094-unknown-instruction-load_fast_load_fast-with-scipy branch February 14, 2025 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unknown instruction 'LOAD_FAST_LOAD_FAST' with SciPy
2 participants