Giter Site home page Giter Site logo

mozillazg / pypy Goto Github PK

View Code? Open in Web Editor NEW
445.0 13.0 65.0 540.41 MB

The unofficial GitHub mirror of PyPy (mirrored via https://github.com/mozillazg/job-mirror-hg-repos)

Home Page: https://foss.heptapod.net/pypy/pypy

License: Other

Makefile 0.08% Python 93.84% HTML 0.26% C 5.37% Shell 0.04% Batchfile 0.02% C++ 0.30% Assembly 0.01% CSS 0.01% HCL 0.01% Emacs Lisp 0.01% PLSQL 0.04% Roff 0.02% M4 0.02% Awk 0.01% VBScript 0.01% Dockerfile 0.01% Vim Script 0.01%
pypy github-mirror unofficial unofficial-mirror read-only-repository readonly

pypy's Introduction

PyPy: Python in Python Implementation

Welcome to PyPy!

PyPy is an interpreter that implements the Python programming language, based on the RPython compiler framework for dynamic language implementations.

The home page for the interpreter is:

https://pypy.org/

If you want to help developing PyPy, this documentation might help you:

https://doc.pypy.org/

More documentation about the RPython framework can be found here:

https://rpython.readthedocs.io/

The source for the documentation is in the pypy/doc directory.

Using PyPy instead of CPython

Please read the information at https://pypy.org/ to find the correct way to download and use PyPy as an alternative to CPython.

Building

Building PyPy is not the recommended way to obtain the PyPy alternative python interpreter. It is time-consuming and requires significant computing resources. More information can be found here:

https://doc.pypy.org/en/latest/build.html

Enjoy and send us feedback!

the pypy-dev team <[email protected]>

pypy's People

Contributors

alex avatar amauryfa avatar anders-chrigstrom avatar antocuni avatar aquamiau avatar arigo avatar bdkearns avatar benjaminp avatar bivab avatar cfbolz avatar ctismer avatar ericvrp avatar fijal avatar groggi avatar hakanardo avatar hpk42 avatar jlg avatar jpeel avatar manueljacob avatar mattip avatar mwhudson avatar pedronis avatar pjenvey avatar planrich avatar ptersilie avatar richemslie avatar rlamy avatar santagada avatar stefanor avatar wlav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pypy's Issues

Error Runing LightGBM "TypeError: expected c_char_p instance instead of int"

Use Linux(centos7), Runing LightGBM In Pypy3, An exception occurs when I run the following code

import joblib

lgb = joblib.load('./catigory_xh.pkl')

for k in lgb.feature_name():
    print(k);

Error Info

Traceback (most recent call last):
  File "/usr/local/src/pypy3.6/lib_pypy/_ctypes/basics.py", line 56, in from_param
    as_parameter = value._as_parameter_
AttributeError: 'int' object has no attribute '_as_parameter_'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "model.py", line 5, in <module>
    for k in lgb.feature_name():
  File "/usr/local/src/pypy3.6/site-packages/lightgbm/basic.py", line 3655, in feature_name
    ptr_string_buffers = (ctypes.c_char_p * num_feature)(*map(ctypes.addressof, string_buffers))
  File "/usr/local/src/pypy3.6/lib_pypy/_ctypes/array.py", line 203, in __init__
    self[i] = arg
  File "/usr/local/src/pypy3.6/lib_pypy/_ctypes/array.py", line 229, in __setitem__
    cobj = self._type_.from_param(value)
  File "/usr/local/src/pypy3.6/lib_pypy/_ctypes/primitive.py", line 372, in from_param
    return super(SimpleType, self).from_param(value)
  File "/usr/local/src/pypy3.6/lib_pypy/_ctypes/basics.py", line 59, in from_param
    self.__name__, type(value).__name__))
TypeError: expected c_char_p instance instead of int

LightGBM version:

Name: lightgbm
Version: 3.3.1
Summary: LightGBM Python Package
Home-page: https://github.com/microsoft/LightGBM
Author: 
Author-email: 
License: The MIT License (Microsoft)
Location: /usr/local/src/pypy3.6/site-packages
Requires: numpy, scikit-learn, scipy, wheel
Required-by: 

Pypy Version:

Python 3.6.12 (db1e853f94de, Nov 18 2020, 09:49:19)
[PyPy 7.3.3 with GCC 7.3.1 20180303 (Red Hat 7.3.1-5)]

In fact, I have tried in other versions, and the error is the same
catigory_xh.pkl

greenlet install failed

I install project dependencies with "poetry install --no-dev", but failed !

  • Updating greenlet (0.4.13 /usr/local/pypy3.7-v7.3.5-linux64/lib_pypy -> 1.1.0)
    [EnvCommandError]
    Command ['/usr/local/pypy/bin/python', '-m', 'pip', 'uninstall', 'greenlet', '-y'] errored with the following return code 1, and output:
    Found existing installation: greenlet 0.4.13
    ERROR: Cannot uninstall 'greenlet'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

Using pypy sandbox for indie game for scripting game assets

I'm looking for a secure and relatively performant environment to run python scripts that influence the game mechanics of my game. The user should be able to mod the game and create python scripts along with other game assets and be able to upload these assets to a server where others can download it. Needless to say these scripts should be run in a contained environment to not cause harm for the unsuspecting end user.

I was led here by this and thought I might look into it. My setup is a bit different that the game will be written in C++ and have pyhton c API bindings for the game API.

As I get from the wiki the sandbox is currently deprecated and a new one is in development progress. I have now two questions:

  1. Is pypy sandbox suitable for my use case?
  2. How is develpment coming along? Can the new sandbox be reliably used alredy?

I like the intricacies of the pypy sandbox as opposed to the not really viable alternatives. Maybe someone knows more as well, I'm open.

Sorry for opening an issue here but I didn't find a discussion thread :)

how is this being mirrored?

I am a PyPy dev, and am considering how we can use some of the nice CI providers available to github projects but not available to other code hosting sites like foss.heptapod.net

I am curious how you are mirroring this. Is there a machine running a cron job somewhere? Would it be reasonable to mirror via a github actions cron task?

Ensuring pip modules work smoothly post pypy installation (after trying ensurepip option)

Im using anaconda's pip as a command line default and have quite a lot of packages already. I just want to make sure the pypy installation done using pip can access these same modules without reinstallations. Is there a quick and easy way?
I tried this way (https://docs.python.org/3/library/ensurepip.html) and Im unable to provide the default pip if I try
./pypy3-c -m ensurepip --default-pip "~/anaconda/bin/pip"

python -m ensurepip: error: unrecognized arguments: ~/anaconda/bin/pip

bencoder problem

# python3 -m pip install bencoder
# python3
Python 3.6.9 (default, Mar 10 2023, 16:46:00)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import bencoder
>>> bencoder.
bencoder.ARRAY_TYPECODE  bencoder.bencode(        bencoder.encode_func
bencoder.BTFailure(      bencoder.decode_dict(    bencoder.func(
bencoder.END_CHAR        bencoder.decode_func     bencoder.key
bencoder.OrderedDict(    bencoder.decode_int(     bencoder.keys
bencoder.bdecode(        bencoder.decode_list(
bencoder.bdecode2(       bencoder.decode_string(
# pypy3 -m pip install bencoder
# pypy3
Python 3.9.17 (3f3f2298ddc56db44bbdb4551ce992d8e9401646, Jun 15 2023, 11:15:53)
[PyPy 7.3.12 with GCC 10.2.1 20210130 (Red Hat 10.2.1-11)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>> import bencoder
bencoder.decode(  bencoder.encode(  bencoder.it       bencoder.re       bencoder.string

the two results are completely different.

possible version mismatch

I am running into a problem with running NURBS-Python and the NURBS-Python_Examples when running with pypy3 returning "ImportError: cannot import name 'ft2font'" and similar errors. My only guess at this point is that Python-3.7 is installed on the system, and pypy appears to be built against 3.6 -- see version info:

Python 3.6.9 (?, Apr 10 2020, 19:47:05)
[PyPy 7.3.1 with GCC 7.3.0]

As far as I can tell it appears to be an issue with the versioning. All tests were passing in version 3.4/5.

Please let me know when you bump to python-3.7 and 3.8 so I can test them against my systems.

Potential Bug in collections.Counter

Abstract:
pypy returns False for

Counter(a=4, b=2, c=0) == Counter(a=4, b=2)

Hi, while writing a simple code, I found a potential bug from Counter class.
As written in abstract, pypy returns False for Counter(a=4, b=2, c=0) == Counter(a=4, b=2),
while Python3 returns True for the same.

The reason seems to be the absence of __eq__ method in pypy's Counter class, while cpython's Counter class has.

Considering the characteristics of the Counter class, returning True to the upper statement seems to be more reasonable. Maybe pypy should add __eq__ statement too.

runing following code in pypy 7.3.12 is 3 times slower than in python 3.8

# -*- coding:gbk -*- #
import itertools
cards=[[i,j,k,l] for i in range(1,11)  for j in range(i,11)for k in range(j,11)for l in range(k,11)]
def twentyfour(cards):
    '''史上最短计算24点代码'''
    for nums in itertools.permutations(cards): # 四个数
        for ops in itertools.product('+-*/', repeat=3): # 三个运算符(可重复!)
            # 构造三种中缀表达式 (bsd)
            bds1 = '({0}{4}{1}){5}({2}{6}{3})'.format(*nums, *ops)  # (a+b)*(c-d)
            bds2 = '(({0}{4}{1}){5}{2}){6}{3}'.format(*nums, *ops)  # (a+b)*c-d
            bds3 = '{0}{4}({1}{5}({2}{6}{3}))'.format(*nums, *ops)  #  a/(b-(c/d))
            for bds in [bds1, bds2, bds3]: # 遍历
                try:
                    if abs(eval(bds) - 24.0) < 1e-10:   # eval函数
                        return bds
                except ZeroDivisionError: # 零除错误!
                    continue
    return 'Not found!'


for card in cards:
    print(card,twentyfour(card))

I run in the way:

D:\>python
Python 3.8.8 (tags/v3.8.8:024d805, Feb 19 2021, 13:18:16) [MSC v.1928 64 bit (AMD64)] on win32
timer64 python 24-short.txt

Kernel  Time =     0.062 =    0%
User    Time =    13.447 =   99%
Process Time =    13.509 =  100%    Virtual  Memory =      8 MB
Global  Time =    13.503 =  100%    Physical Memory =     12 MB

D:\>pypy3.10-v7.3.12-win64\pypy
Python 3.10.12 (af44d0b8114cb82c40a07bb9ee9c1ca8a1b3688c, Jun 15 2023, 15:42:22)
[PyPy 7.3.12 with MSC v.1929 64 bit (AMD64)] on win32

timer64 pypy3.10-v7.3.12-win64\pypy 24-short.txt
Kernel  Time =     0.046 =    0%
User    Time =    38.516 =   99%
Process Time =    38.563 =   99%    Virtual  Memory =     36 MB
Global  Time =    38.655 =  100%    Physical Memory =     34 MB

Forgotten (?) print statement in the ssl module in pypy3.10-v7.3.13

Right here:

    def load_verify_locations(self, cafile=None, capath=None, cadata=None):
        ...
            # load cafile or capath
            if cafile is not None or capath is not None:
                print(cafile, capath)
                ^^^^^^^^^^^^^^^^

I couldn't find this on master, so it's been cleaned up at some point but it's currently in the source for the latest pypy release.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.