Skip to content

Commit

Permalink
Merge branch 'main' into tristate
Browse files Browse the repository at this point in the history
  • Loading branch information
cfbolz committed Jan 5, 2024
2 parents 40622d7 + d2ac4b6 commit 19827a9
Show file tree
Hide file tree
Showing 18 changed files with 239 additions and 91 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/named-branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 'Named Branches'
on: push
permissions:
contents: write
jobs:
named-branches:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Fetch 100 commits maximum when setting named branches.
# We can play with this number, but setting this to 0 takes 2 full
# minutes to checkout the repo.
fetch-depth: 100
- uses: Julian/named-branch-action@v1
with:
github_token: '${{ secrets.GITHUB_TOKEN }}'
54 changes: 54 additions & 0 deletions .github/workflows/translate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Translate PyPy

on:
push:
branches: [ "main", "py3.9", "py3.10"]
pull_request:
branches: [ "main", "py3.9", "py3.10"]
workflow_dispatch:

permissions:
contents: read

jobs:
build:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Set up PyPy 2.7
uses: actions/setup-python@v4
with:
python-version: "pypy-2.7-v7.3.10"

- name: install dependencies
run: |
sudo apt install libffi-dev pkg-config zlib1g-dev libbz2-dev libsqlite3-dev libncurses5-dev libexpat1-dev libssl-dev libgdbm-dev tk-dev libgc-dev liblzma-dev libncursesw5-dev patchelf
pypy -m pip install -r requirements.txt
- name: run objspace unit tests
run: |
pypy pytest.py pypy/objspace -v
- name: translate
run: |
pypy rpython/bin/rpython -Ojit pypy/goal/targetpypystandalone.py
mv pypy*-c libpypy*-c.so pypy/goal/
- name: package
run: |
./pypy/goal/pypy*-c pypy/tool/release/package.py --make-portable
- name: upload
uses: actions/upload-artifact@v3
with:
name: pypy-ci-build-${{ matrix.os }}
path: /tmp/usession-pypy-*-runner/build/pypy-nightly.tar.bz2
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,22 @@ release/
!pypy/tool/release/
rpython/_cache/
.cache/
lib_pypy/_audioop_cffi*
lib_pypy/_curses_cffi*
lib_pypy/_gdbm_cffi*
lib_pypy/_lzma_cffi*
lib_pypy/_posixshmem_cffi*
lib_pypy/_pwdgrp_cffi*
lib_pypy/_pypy_openssl*
lib_pypy/_pypy_util_cffi_inner*
lib_pypy/_resource_cffi*
lib_pypy/_sqlite3_cffi*
lib_pypy/_syslog_cffi*
lib_pypy/_tkinter/tklib_cffi*
rpython/rlib/rvmprof/src/shared/libbacktrace/config.h
include/pypy*
lib/pypy*
pypy/doc/config/*.rst
pypy/doc/config/*.txt
pypy/doc/_build

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ directories is licensed as follows:
DEALINGS IN THE SOFTWARE.


PyPy Copyright holders 2003-2023
PyPy Copyright holders 2003-2024
--------------------------------

Except when otherwise stated (look for LICENSE files or information at
Expand Down
20 changes: 20 additions & 0 deletions extra_tests/test_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,23 @@ def test_platform_not_imported():
modules = [x.strip(' "\'') for x in out.strip().strip('[]').split(',')]
assert 'platform' not in modules
assert 'threading' not in modules


def test_executable_win32():
# issue #4003
import os
import subprocess
import sys

out = subprocess.check_output([r'*', '-c',
'import sys; print (repr(sys.executable))'], universal_newlines=True, executable=sys.executable)
if sys.platform == 'win32':
assert out.strip() == repr(sys.executable)

fake_executable = r'C:\Windows\System32\cmd.exe'
assert os.path.isfile(fake_executable) # should exist always
out = subprocess.check_output([fake_executable, '-c',
'import sys; print (repr(sys.executable))'], universal_newlines=True, executable=sys.executable)
assert out.strip() == repr(sys.executable)
else:
assert out.strip() == repr('')
6 changes: 3 additions & 3 deletions pypy/doc/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ Clone the repository
If you prefer to compile your own PyPy, or if you want to modify it, you
will need to obtain a copy of the sources. This can be done either by
`downloading them from the download page`_ or by checking them out from the
repository using mercurial. We suggest using mercurial if you want to access
repository using git. We suggest using git if you want to access
the current development.

.. _downloading them from the download page: https://www.pypy.org/download.html

You must issue the following command on your
command line, DOS box, or terminal::

hg clone https://foss.heptapod.net/pypy/pypy pypy
git clone https://github.com/pypy/pypy.git

This will clone the repository and place it into a directory
named ``pypy``, and will get you the PyPy source in ``pypy/pypy`` and
Expand Down Expand Up @@ -97,7 +97,7 @@ after building PyPy, otherwise the corresponding CFFI modules are not
built (you can run or re-run `lib_pypy/pypy_tools/build_cffi_imports.py`_ to
build them; you don't need to re-translate the whole PyPy):

.. _`lib_pypy/pypy_tools/build_cffi_imports.py`: https://foss.heptapod.net/pypy/pypy/-/blob/branch/default/lib_pypy/pypy_tools/build_cffi_imports.py
.. _`lib_pypy/pypy_tools/build_cffi_imports.py`: https://github.com/pypy/pypy/blob/main/lib_pypy/pypy_tools/build_cffi_imports.py

sqlite3
libsqlite3
Expand Down
4 changes: 2 additions & 2 deletions pypy/doc/coding-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ Committing & Branching to the repository
Using the development bug/feature tracker
-----------------------------------------

We use https://foss.heptapod.net/pypy/pypy for :source:`issues` tracking and
We use https://github.com/pypy/pypy for :source:`issues` tracking and
:source:`pull-requests`.

.. _testing:
Expand Down Expand Up @@ -735,7 +735,7 @@ files. Here is a `ReST quickstart`_ but you can also just look
at the existing documentation and see how things work.

Note that the web site of https://pypy.org/ is maintained separately.
It is in the repository https://foss.heptapod.net/pypy/pypy.org
It is in the repository https://github.com/pypy/pypy.org

.. _ReST quickstart: https://docutils.sourceforge.net/docs/user/rst/quickref.html

Expand Down
68 changes: 22 additions & 46 deletions pypy/doc/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ coding sprints which are separately announced and are usually announced on `the
blog`_.

Like any Open Source project, issues should be filed on the `issue tracker`_,
and `merge requests`_ to fix issues are welcome.
and `pull requests`_ to fix issues are welcome.

Further Reading: :ref:`Contact <contact>`

.. _the blog: https://pypy.org/blog
.. _pypy-dev mailing list: https://mail.python.org/mailman/listinfo/pypy-dev
.. _`PyPy group page`: https://foss.heptapod.net/pypy
.. _`merge requests`: https://foss.heptapod.net/heptapod/foss.heptapod.net/-/merge_requests
.. _`PyPy group page`: https://github.com/pypy
.. _`pull requests`: https://github.com/pypy/pypy/pulls/


Your first contribution
Expand All @@ -77,14 +77,16 @@ Some ideas for first contributions are:
* Missing language features - these are listed in our `issue tracker`_

.. _nightly builds: https://buildbot.pypy.org/nightly/
.. _issue tracker: https://foss.heptapod.net/pypy/pypy/issues
.. _issue tracker: https://github.com/pypy/pypy/issues/

Source Control
--------------

PyPy's main repositories are hosted here: https://foss.heptapod.net/pypy.
PyPy's main git repositories are hosted here: https://github.com/pypy,
and legacy repositories are hosted here: https://foss.heptapod.net/pypy.

`Heptapod <https://heptapod.net/>`_ is a friendly fork of GitLab Community
Pypy's legacy repositories are hosted on `Heptapod <https://heptapod.net/>`_.
Heptapod is a friendly fork of GitLab Community
Edition supporting Mercurial. https://foss.heptapod.net is a public instance
for Free and Open-Source Software (more information `here
<https://foss.heptapod.net/heptapod/foss.heptapod.net>`_).
Expand All @@ -102,65 +104,39 @@ Thanks to `Octobus <https://octobus.net/>`_ and `Clever Cloud
</a>
</h1>

Get Access
----------

As stated above, you need to request access to the repo.
Since the free hosting on foss.heptapod.net does not allow personal forks, you
need permissions to push your changes directly to our repo. Once you sign in to
https://foss.heptapod.net using either a new login or your GitHub or Atlassian
logins, you can get developer status for pushing directly to
the project (just ask by clicking the link at foss.heptapod.net/pypy just under
the logo, and you'll get it, basically). Once you have it you can rewrite your
file ``.hg/hgrc`` to contain ``default = ssh://[email protected]/pypy/pypy``.
Your changes will then be pushed directly to a branch on the official repo, and
we will review the branches you want to merge.

Clone
-----

* Clone the PyPy repo to your local machine with the command
``hg clone https://foss.heptapod.net/pypy/pypy``. It takes a minute or two
``git clone https://github.com/pypy/pypy.git``. It takes a minute or two
operation but only ever needs to be done once. See also
https://pypy.org/download.html#building-from-source .
If you already cloned the repo before, even if some time ago,
then you can reuse the same clone by editing the file ``.hg/hgrc`` in
your clone to contain the line ``default =
https://foss.heptapod.net/pypy/pypy``, and then do ``hg pull && hg
up``. If you already have such a clone but don't want to change it,
you can clone that copy with ``hg clone /path/to/other/copy``, and
then edit ``.hg/hgrc`` as above and do ``hg pull && hg up``.

* Now you have a complete copy of the PyPy repo. Make a long-lived branch
with a command like ``hg branch name_of_your_branch``.

* Now you have a complete copy of the PyPy repo.

Edit
----

* Edit things. Use ``hg diff`` to see what you changed. Use ``hg add``
to make Mercurial aware of new files you added, e.g. new test files.
Use ``hg status`` to see if there are such files. Write and run tests!
* Edit things. Use ``git diff`` to see what you changed. Use ``git add``
to make git aware of new files you added, e.g. new test files.
Use ``git status`` to see if there are such files. Write and run tests!
(See the rest of this page.)

* Commit regularly with ``hg commit``. A one-line commit message is
* Commit regularly with ``git commit``. A one-line commit message is
fine. We love to have tons of commits; make one as soon as you have
some progress, even if it is only some new test that doesn't pass yet,
or fixing things even if not all tests pass. Step by step, you are
building the history of your changes, which is the point of a version
control system. (There are commands like ``hg log`` and ``hg up``
control system. (There are commands like ``git log``
that you should read about later, to learn how to navigate this
history.)

* The commits stay on your machine until you do ``hg push`` to "push"
them back to the repo named in the file ``.hg/hgrc``. Repos are
basically just collections of commits (a commit is also called a
changeset): there is one repo per url, plus one for each local copy on
each local machine. The commands ``hg push`` and ``hg pull`` copy
* The commits stay on your machine until you do ``git push`` to "push"
them back to your fork. The commands ``git push`` and ``git pull`` copy
commits around, with the goal that all repos in question end up with
the exact same set of commits. By opposition, ``hg up`` only updates
the "working copy" by reading the local repository, i.e. it makes the
files that you see correspond to the latest (or any other) commit
locally present.
the exact same set of commits.

* You should push often; there is no real reason not to. Remember that
even if they are pushed, with the setup above, the commits are only in the
Expand All @@ -172,10 +148,10 @@ Edit
accept it as is for PyPy, asking you instead to improve some things,
but we are not going to judge you unless you don't write tests.

Merge Request
Pull Request
-------------

* The final step is to open a merge request, so that we know that you'd
* The final step is to open a pull request, so that we know that you'd
like to merge that branch back to the original ``pypy/pypy`` repo.
This can also be done several times if you have interesting
intermediate states, but if you get there, then we're likely to
Expand All @@ -185,7 +161,7 @@ Merge Request
that we generally push small changes as one or a few commits directly
to the branch ``default`` or ``py3.9``. Also, we often collaborate even if
we are on other branches, which do not really "belong" to anyone. At this
point you'll need ``hg merge`` and learn how to resolve conflicts that
point you'll need ``git merge`` and learn how to resolve conflicts that
sometimes occur when two people try to push different commits in
parallel on the same branch. But it is likely an issue for later ``:-)``

Expand Down
10 changes: 5 additions & 5 deletions pypy/doc/cpython_differences.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ object and the weakref will be considered as dead at the same time,
and the callback will not be invoked. (Issue `#2030`__)

.. __: https://docs.python.org/2/library/weakref.html
.. __: https://foss.heptapod.net/pypy/pypy/-/issues/2030/
.. __: https://github.com/pypy/pypy/issues/2030/

A new difference: before CPython 3.4, a weakref to ``x`` was always
cleared before the ``x.__del__()`` method was called. Since CPython 3.4
Expand Down Expand Up @@ -117,7 +117,7 @@ difference if the ``yield`` keyword it is suspended at is itself
enclosed in a ``try:`` or a ``with:`` block. This shows up for example
as `issue 736`__.

.. __: https://foss.heptapod.net/pypy/pypy/-/issues/736
.. __: https://github.com/pypy/pypy/issues/736

Using the default GC (called ``minimark``), the built-in function ``id()``
works like it does in CPython. With other GCs it returns numbers that
Expand Down Expand Up @@ -301,7 +301,7 @@ Another consequence is that ``cmp(float('nan'), float('nan')) == 0``, because
no good value to return from this call to ``cmp``, because ``cmp`` pretends
that there is a total order on floats, but that is wrong for NaNs).

.. __: https://foss.heptapod.net/pypy/pypy/-/issues/1974
.. __: https://github.com/pypy/pypy/issues/1974

Permitted ABI tags in extensions
--------------------------------
Expand Down Expand Up @@ -690,6 +690,6 @@ that are neither mentioned above nor in :source:`lib_pypy/` are not available in

.. _`is ignored in PyPy`: https://bugs.python.org/issue14621
.. _`little point`: https://events.ccc.de/congress/2012/Fahrplan/events/5152.en.html
.. _`#2072`: https://foss.heptapod.net/pypy/pypy/-/issues/2072/
.. _`issue #2653`: https://foss.heptapod.net/pypy/pypy/-/issues/2653/
.. _`#2072`: https://github.com/pypy/pypy/issues/2072/
.. _`issue #2653`: https://github.com/pypy/pypy/issues/2653/
.. _SyntaxError: https://www.pypy.org/posts/2018/04/improving-syntaxerror-in-pypy-5733639208090522433.html
12 changes: 6 additions & 6 deletions pypy/doc/dev_method.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Distributed and agile development in PyPy
.. note::
This page describes the mode of development that preceeds the current models
of Open Source development. While people are welcome to join our (now yearly)
sprints, we encourage engagement via the gitlab repo at
https://foss.heptapod.net/pypy/pypy. Issues can be filed and discussed in the
`issue tracker`_ and we welcome `merge requests`_.
sprints, we encourage engagement via the GitHub repo at
https://github.com/pypy/pypy/. Issues can be filed and discussed in the
`issue tracker`_ and we welcome `pull requests`_.

.. _`issue tracker`: https://foss.heptapod.net/heptapod/foss.heptapod.net/-/issues
.. _`merge requests`: https://foss.heptapod.net/heptapod/foss.heptapod.net/-/merge_requests
.. _`issue tracker`: https://github.com/pypy/pypy/issues/
.. _`pull requests`: https://github.com/pypy/pypy/pulls/

PyPy isn't just about producing code - it's also about how we produce code.
The challenges of coordinating work within a community and making sure it is
Expand All @@ -30,7 +30,7 @@ Main methods for achieving this is:
Main tools for achieving this is:

* py.test - automated testing
* Mercurial - version control
* Git - version control
* Transparent communication and documentation (mailinglists, IRC, tutorials
etc etc)

Expand Down
Loading

0 comments on commit 19827a9

Please sign in to comment.