From 4aa4ef04659f2fff1aedf93cd338756f7ee96724 Mon Sep 17 00:00:00 2001 From: mayantaylor Date: Sat, 3 Aug 2024 09:59:16 -0500 Subject: [PATCH 01/22] greenlet 3.0.0 drops support for python 3.6 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 2d9df824..568b0752 100644 --- a/setup.py +++ b/setup.py @@ -392,7 +392,7 @@ def install(self): ], }, install_requires=['numpy>=1.10.0', 'greenlet>=3.0.0', 'cython>=3.0.0', 'cmake'], - python_requires='~=3.6', + python_requires='>=3.7', classifiers=[ 'Intended Audience :: Developers', 'License :: Free for non-commercial use', From d928ba03248ad592883d758b389aa2e8b8d6431f Mon Sep 17 00:00:00 2001 From: mayantaylor Date: Sun, 4 Aug 2024 08:59:41 -0500 Subject: [PATCH 02/22] draft pyproject.toml --- pyproject.toml | 43 +++++++++++++++++++++++++++++++++++++++++++ setup.py | 29 ----------------------------- 2 files changed, 43 insertions(+), 29 deletions(-) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..91483422 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,43 @@ +[build-system] +requires = ["setuptools>=43.0.0", "cython>=3.0.0", "numpy>=1.10.0"] +build-backend = "setuptools.build_meta" + +[project] +description = 'Charm4py Parallel Programming Framework' +authors = [ + { name = "Juan Galvez", email = "jjgalvez@illinois.edu" }, + { name = "Maya Taylor", email = "mayat4@illinois.edu" }, +] +maintainers = [{ name = "Maya Taylor", email = "mayat4@illinois.edu" }] +name = "charm4py" +dynamic = ["version"] +readme = { file = "README.rst", content-type = "text/x-rst" } +keywords = [ + "parallel", + "parallel programming", + "distributed computing", + "distributed", + "hpc", + "HPC", + "runtime", +] +requires-python = ">=3.7" +classifiers = [ + 'Intended Audience :: Developers', + 'License :: Free for non-commercial use', + 'Operating System :: MacOS :: MacOS X', + 'Operating System :: POSIX', + 'Operating System :: POSIX :: Linux', + 'Operating System :: Microsoft :: Windows', + 'Programming Language :: Python', + 'Programming Language :: Python :: 3', + 'Topic :: System :: Distributed Computing', + 'Topic :: System :: Clustering', +] + +[project.urls] +Documentation = "https://charm4py.readthedocs.io" +Repository = "https://github.com/charmplusplus/charm4py" + +[project.scripts] +charmrun = 'charmrun.start:start' diff --git a/setup.py b/setup.py index 2d9df824..19280c39 100644 --- a/setup.py +++ b/setup.py @@ -369,42 +369,13 @@ def install(self): additional_setup_keywords['cffi_modules'] = 'charm4py/charmlib/charmlib_cffi_build.py:ffibuilder' -with open('README.rst', 'r') as f: - long_description = f.read() - - setuptools.setup( - name='charm4py', version=charm4py_version, - author='Juan Galvez and individual contributors', - author_email='jjgalvez@illinois.edu', - description='Charm4py Parallel Programming Framework', - long_description=long_description, - url='https://github.com/charmplusplus/charm4py', - keywords='parallel parallel-programming distributed distributed-computing hpc HPC runtime', packages=setuptools.find_packages(), package_data={ 'charm4py': ['libcharm_version'], }, - entry_points={ - 'console_scripts': [ - 'charmrun = charmrun.start:start', - ], - }, install_requires=['numpy>=1.10.0', 'greenlet>=3.0.0', 'cython>=3.0.0', 'cmake'], - python_requires='~=3.6', - classifiers=[ - 'Intended Audience :: Developers', - 'License :: Free for non-commercial use', - 'Operating System :: MacOS :: MacOS X', - 'Operating System :: POSIX', - 'Operating System :: POSIX :: Linux', - 'Operating System :: Microsoft :: Windows', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3', - 'Topic :: System :: Distributed Computing', - 'Topic :: System :: Clustering', - ], ext_modules=extensions, cmdclass = {'build_py': custom_build_py, 'build_ext': custom_build_ext, From 02137a0e0677dd25d2821a1d4dcbba4877f3a3ff Mon Sep 17 00:00:00 2001 From: mayantaylor Date: Sun, 4 Aug 2024 15:59:40 -0500 Subject: [PATCH 03/22] adding templated build wheel yaml --- .github/workflows/build_wheels.yml | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/build_wheels.yml diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml new file mode 100644 index 00000000..9fe3ab21 --- /dev/null +++ b/.github/workflows/build_wheels.yml @@ -0,0 +1,31 @@ +name: Build wheels + +on: + workflow_dispatch: + pull_request: + push: + branches: + - maya/modernize-buildß + release: + types: + - published + +jobs: + build_wheels: + name: Build wheels on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + # macos-13 is an intel runner, macos-14 is apple silicon + os: [ubuntu-latest, windows-latest, macos-13, macos-14] + + steps: + - uses: actions/checkout@v4 + + - name: Build wheels + uses: pypa/cibuildwheel@v2.20.0 + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl From caf3095fe6d3ed3e5bf0229df9a16137de6175fc Mon Sep 17 00:00:00 2001 From: mayantaylor Date: Sun, 4 Aug 2024 16:36:40 -0500 Subject: [PATCH 04/22] set up build wheel action manually specifying package dir formatting typo manual cibuildwheel command? one dir down? adding debug info typo testing git installation clean up print statements typos removing 'build' dependency separating workflows adding testpypi workflow --- .github/workflows/build_wheels.yml | 37 +++++++++++++++++++-------- .github/workflows/upload_testpypi.yml | 27 +++++++++++++++++++ setup.py | 2 +- 3 files changed, 55 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/upload_testpypi.yml diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 9fe3ab21..a3288237 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -1,14 +1,6 @@ name: Build wheels -on: - workflow_dispatch: - pull_request: - push: - branches: - - maya/modernize-buildß - release: - types: - - published +on: workflow_dispatch jobs: build_wheels: @@ -17,12 +9,37 @@ jobs: strategy: matrix: # macos-13 is an intel runner, macos-14 is apple silicon - os: [ubuntu-latest, windows-latest, macos-13, macos-14] + os: [ubuntu-latest, macos-13, macos-14] steps: + - uses: actions/setup-python@v5 + with: + python-version: 3.8 + if: runner.os == 'macOS' && runner.arch == 'ARM64' + - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch full history, necessary for git describe in setup.py + + - name: Checkout charm_src # is this best practice? should we use a submodule? + uses: actions/checkout@v4 + with: + repository: charmplusplus/charm + token: ${{ secrets.GITHUB_TOKEN }} + path: charm_src/charm + fetch-depth: 0 # Fetch full history, necessary for commit_str parsing in setup.py + + - name: Checkout charm_src # is this best practice? should we use a submodule? + uses: actions/checkout@v4 + with: + repository: charmplusplus/charm + token: ${{ secrets.GITHUB_TOKEN }} + path: charm_src/charm + fetch-depth: 0 # Fetch full history, necessary for commit_str parsing in setup.py - name: Build wheels + env: + CIBW_SKIP: "pp* *-manylinux_i686 *-manylinux_ppc64le *-manylinux_s390x *musllinux_*" uses: pypa/cibuildwheel@v2.20.0 - uses: actions/upload-artifact@v4 diff --git a/.github/workflows/upload_testpypi.yml b/.github/workflows/upload_testpypi.yml new file mode 100644 index 00000000..3ce9be5d --- /dev/null +++ b/.github/workflows/upload_testpypi.yml @@ -0,0 +1,27 @@ +name: Publish wheels to testpypi + +on: workflow_dispatch + +jobs: + publish_test: + name: Publish Python 🐍 distribution 📦 to TestPyPI + runs-on: ubuntu-latest + + environment: + name: testpypi + url: https://test.pypi.org/p/charm4py + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: actions/download-artifact@v3 + with: + pattern: cibw-* # download all the wheels + path: dist + merge-multiple: true + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ diff --git a/setup.py b/setup.py index 19280c39..e5b5c1f5 100644 --- a/setup.py +++ b/setup.py @@ -375,7 +375,7 @@ def install(self): package_data={ 'charm4py': ['libcharm_version'], }, - install_requires=['numpy>=1.10.0', 'greenlet>=3.0.0', 'cython>=3.0.0', 'cmake'], + #install_requires=['numpy>=1.10.0', 'greenlet>=3.0.0', 'cython>=3.0.0', 'cmake'], ext_modules=extensions, cmdclass = {'build_py': custom_build_py, 'build_ext': custom_build_ext, From 8e568e87f15ba5f43fc55b1a341c5cd5a8dae78f Mon Sep 17 00:00:00 2001 From: mayantaylor Date: Mon, 5 Aug 2024 07:49:23 -0500 Subject: [PATCH 05/22] set up testpypi upload action --- .github/workflows/upload_testpypi.yml | 23 ++++++++++++++++++----- pyproject.toml | 1 + requirements.txt | 4 ++-- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/upload_testpypi.yml b/.github/workflows/upload_testpypi.yml index 3ce9be5d..b84e78a0 100644 --- a/.github/workflows/upload_testpypi.yml +++ b/.github/workflows/upload_testpypi.yml @@ -1,6 +1,12 @@ name: Publish wheels to testpypi -on: workflow_dispatch +on: + workflow_dispatch: + inputs: + workflow_id: + description: "The workflow ID to pull wheels from" + required: true + type: string jobs: publish_test: @@ -16,11 +22,18 @@ jobs: steps: - name: Download all the dists - uses: actions/download-artifact@v3 + uses: dawidd6/action-download-artifact@v2 with: - pattern: cibw-* # download all the wheels - path: dist - merge-multiple: true + # download all the wheels + path: unmerged + run_id: ${{ github.event.inputs.workflow_id }} + workflow: build_wheels.yml + + - name: Merge files to dist + run: | + mkdir dist + mv unmerged/*/*.whl dist + - name: Publish distribution 📦 to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 with: diff --git a/pyproject.toml b/pyproject.toml index 91483422..472a059d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ keywords = [ "runtime", ] requires-python = ">=3.7" +dependencies = ["numpy>=1.10.0", "greenlet>=3.0.0"] classifiers = [ 'Intended Audience :: Developers', 'License :: Free for non-commercial use', diff --git a/requirements.txt b/requirements.txt index 4cb33f6c..86fef003 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -cython>=3.0.0 -numpy +numpy>=1.10.0 greenlet>=3.0.0 # Required for the charm++ build: cmake +cython>=3.0.0 \ No newline at end of file From b34899673b59ac0fb2771ba8559bb69335aa11ad Mon Sep 17 00:00:00 2001 From: mayantaylor Date: Mon, 5 Aug 2024 09:36:43 -0500 Subject: [PATCH 06/22] don't need cmake? not used --- requirements.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 86fef003..e4cc4847 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,3 @@ numpy>=1.10.0 greenlet>=3.0.0 - -# Required for the charm++ build: -cmake cython>=3.0.0 \ No newline at end of file From 24a546cb67842d0b619952b548626a57ce947393 Mon Sep 17 00:00:00 2001 From: mtaylo12 Date: Tue, 13 Aug 2024 11:26:35 -0500 Subject: [PATCH 07/22] cleanup --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index e5b5c1f5..2d2d1516 100644 --- a/setup.py +++ b/setup.py @@ -375,7 +375,6 @@ def install(self): package_data={ 'charm4py': ['libcharm_version'], }, - #install_requires=['numpy>=1.10.0', 'greenlet>=3.0.0', 'cython>=3.0.0', 'cmake'], ext_modules=extensions, cmdclass = {'build_py': custom_build_py, 'build_ext': custom_build_ext, From 1e39a5b2867179c9b3e2610d1f1e5352f7d61dc9 Mon Sep 17 00:00:00 2001 From: Maya Taylor Date: Sun, 25 Aug 2024 11:07:56 -0500 Subject: [PATCH 08/22] adding pypy builds --- .github/workflows/build_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index a3288237..61cdc8bc 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -39,7 +39,7 @@ jobs: - name: Build wheels env: - CIBW_SKIP: "pp* *-manylinux_i686 *-manylinux_ppc64le *-manylinux_s390x *musllinux_*" + CIBW_SKIP: "*-manylinux_i686 *-manylinux_ppc64le *-manylinux_s390x *musllinux_*" uses: pypa/cibuildwheel@v2.20.0 - uses: actions/upload-artifact@v4 From 71e3c6afa1fb0ac502a8f1cbbf4c145a6c3698be Mon Sep 17 00:00:00 2001 From: Maya Taylor Date: Sun, 25 Aug 2024 12:18:09 -0500 Subject: [PATCH 09/22] work around pypy dev0 checkout --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a516e653..f77d0ffb 100644 --- a/setup.py +++ b/setup.py @@ -118,7 +118,10 @@ def check_libcharm_version(charm_src_dir): def check_cffi(): try: import cffi - version = tuple(int(v) for v in cffi.__version__.split('.')) + version_str = cffi.__version__.split('.') + if (len(version_str) > 3): + version_str = version_str[:3] + version = tuple(int(v) for v in version_str) if version < (1, 7): raise DistutilsSetupError('Charm4py requires cffi >= 1.7. ' 'Installed version is ' + cffi.__version__) From 519f49f9f80cceaa5dc28486d96d5128841812a1 Mon Sep 17 00:00:00 2001 From: Maya Taylor Date: Sun, 25 Aug 2024 12:36:51 -0500 Subject: [PATCH 10/22] adding comments --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f77d0ffb..25b7cd0e 100644 --- a/setup.py +++ b/setup.py @@ -119,8 +119,11 @@ def check_cffi(): try: import cffi version_str = cffi.__version__.split('.') - if (len(version_str) > 3): + + # pypy3.9 returns version string like '1.17.0.dev0' + if (len(version_str) > 3): version_str = version_str[:3] + version = tuple(int(v) for v in version_str) if version < (1, 7): raise DistutilsSetupError('Charm4py requires cffi >= 1.7. ' From 3e95006a417023397042e959cdbb15d2cb89782a Mon Sep 17 00:00:00 2001 From: Maya Taylor Date: Mon, 26 Aug 2024 10:37:25 -0500 Subject: [PATCH 11/22] updating installation instructions --- docs/install.rst | 79 ++++++++++++++++++++++++++---------------------- 1 file changed, 43 insertions(+), 36 deletions(-) diff --git a/docs/install.rst b/docs/install.rst index 2f079513..6117d3b7 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -7,59 +7,65 @@ Install Charm4py runs on Linux, macOS, Windows, Raspberry Pi, and a wide variety of clusters and supercomputer environments (including many supercomputers in the TOP500). -Charm4py runs on Python 3.4+. Charm4py has been tested with the +Charm4py runs on Python 3.7+. Charm4py has been tested with the following Python implementations: CPython (most common implementation) and PyPy_. .. _PyPy: https://pypy.org +Installing Charm4Py binaries (via pip) +--------------------------------------- -Installing Charm4Py on a laptop/personal machine ------------------------------------------------- +The easiest way to install Charm4Py is via pip. Currently, pip wheels are available for Linux and macOS. -This install process covers the installation of Charm4Py on a laptop or personal machine, as opposed to a cluster. +To install the latest release of Charm4Py, run:: + + $ pip install charm4py + +This will install the latest stable release of Charm4Py, using the default underlying Charm++ build +(see the `Charm++ manual`_ for more information on the different builds of Charm++). If you want to +use a specific Charm++ build, you can install and build Charm4Py from source. + +Installing Charm4Py from source +------------------------------------------------------------ + +This install process covers the installation of Charm4Py from source. Before installing, you need the following prerequisites: - - CPython: numpy, greenlet and cython (``pip3 install 'numpy>=1.10.0' cython greenlet``) + - CPython: numpy, greenlet and cython (``pip install numpy>=1.10.0 greenlet>=3.0.0 cython>=3.0.0``) - PyPy: none You can get these prerequisites by running the following command:: - $ pip3 install -r requirements.txt + $ pip install -r requirements.txt The first step is to clone the Charm4py repository from Git:: $ git clone https://github.com/charmplusplus/charm4py.git $ cd charm4py -Next, create a folder called charm_src in the charm4py repo, and then clone the Charm++ repo -into that folder:: +Next, clone the Charm++ repo into charm_src:: - $ mkdir charm_src && cd charm_src - $ git clone https://github.com/charmplusplus/charm.git + $ git clone https://github.com/charmplusplus/charm.git charm_src/charm -Once this is done, there are two ways to build Charm4py. The first way is to change back up -into the Charm4Py directory and run the install script:: +Once this is done, there are two ways to build Charm4py. The first is to simply run the installation +from the Charm4py root. This method will use the default Charm++ backend:: $ cd .. - $ python3 setup.py install + $ pip install . -The other option is to manually build Charm++ before building Charm4py. To do this, change to -the charm directory and run the following build command:: +The other option is to manually build Charm++ before building Charm4py. This may be necessary +if you want to configure Charm++ differently from the default. To do this, change to +the charm directory and run the following build command, then build Charm4Py:: $ cd charm - $ ./build charm4py netlrts-- -j --with-production - -For building on a laptop, you must use a netlrts build of Charm4Py. Check the Charm++ documentation -to identify the correct os and architecture command to pass into the build command. The -j option -is a cmake option that launches N threads for the make. - -Then, return to the charm4py directory and run setup.py:: - + $ ./build charm4py -j --with-production $ cd ../.. - $ python3 setup.py install + $ pip install . +Finally, if necessary, when installing dependencies or when running the install script, add the --user +option to the Python command to complete the installation without permission errors. After building, you can run Charm4py examples. One example you can try is array_hello.py, which can be run as follows:: @@ -67,22 +73,23 @@ array_hello.py, which can be run as follows:: $ cd examples/hello $ python -m charmrun.start +p2 array_hello.py -Installing Charm4Py on a cluster machine ----------------------------------------- - -To install Charm4Py on a cluster machine, you will generally follow the same steps as above, but -with the following changes. First, when building Charm++, use the MPI build instead of the netlrts -build:: +Choosing your target architecture when building from source +------------------------------------------------------------ - $ ./build charm4py mpi-- -j --with-production +When building from source, as described above, you must chose the appropriate target architecture. -Next, pass in the MPI option to the python setup script:: +For building on a laptop or personal machine, you must use a netlrts build of Charm4Py. +For example, to build for a personal machine running macOS with ARM processors, using 4 cmake +threads, you would run:: + + $ ./build charm4py netlrts-darwin-arm -j4 --with-production - $ python3 setup.py install --mpi - -Finally, if necessary, when installing dependencies or when running the install script, add the --user -option to the Python command to complete the installation without permission errors. +To install Charm4Py on a cluster machine, you will generally want to chose a different backend. +For example, to use Charm4Py with MPI, build the Charm backend as follows:: + $ ./build charm4py mpi-- -j --with-production +Check the Charm++ documentation to identify the correct os and architecture command +to pass into the build command. .. _manual: https://charm.readthedocs.io/en/latest/charm++/manual.html#installing-charm From acdaaa8daad1915269ede0a6cc0ce4f6c3b98585 Mon Sep 17 00:00:00 2001 From: Maya Taylor Date: Mon, 26 Aug 2024 15:39:32 -0500 Subject: [PATCH 12/22] action to publish to pypi --- .github/workflows/upload_pypi.yml | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/upload_pypi.yml diff --git a/.github/workflows/upload_pypi.yml b/.github/workflows/upload_pypi.yml new file mode 100644 index 00000000..e1aa42a0 --- /dev/null +++ b/.github/workflows/upload_pypi.yml @@ -0,0 +1,38 @@ +name: Publish wheels to pypi + +on: + workflow_dispatch: + inputs: + workflow_id: + description: "The workflow ID to pull wheels from" + required: true + type: string + +jobs: + publish: + name: Publish Python 🐍 distribution 📦 to PyPI + runs-on: ubuntu-latest + + environment: + name: pypi + url: https://pypi.org/p/charm4py + + permissions: + id-token: write # IMPORTANT: mandatory for trusted publishing + + steps: + - name: Download all the dists + uses: dawidd6/action-download-artifact@v2 + with: + # download all the wheels + path: unmerged + run_id: ${{ github.event.inputs.workflow_id }} + workflow: build_wheels.yml + + - name: Merge files to dist + run: | + mkdir dist + mv unmerged/*/*.whl dist + + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 From 0a865144915aed3541aa0cc385aa87dedae20bf7 Mon Sep 17 00:00:00 2001 From: Maya Taylor Date: Mon, 26 Aug 2024 15:46:01 -0500 Subject: [PATCH 13/22] tmp commit to get action to flush --- .github/workflows/upload_pypi.yml | 36 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/upload_pypi.yml b/.github/workflows/upload_pypi.yml index e1aa42a0..9f02a7c5 100644 --- a/.github/workflows/upload_pypi.yml +++ b/.github/workflows/upload_pypi.yml @@ -1,12 +1,12 @@ name: Publish wheels to pypi -on: - workflow_dispatch: - inputs: - workflow_id: - description: "The workflow ID to pull wheels from" - required: true - type: string +# on: +# workflow_dispatch: +# inputs: +# workflow_id: +# description: "The workflow ID to pull wheels from" +# required: true +# type: string jobs: publish: @@ -23,16 +23,16 @@ jobs: steps: - name: Download all the dists uses: dawidd6/action-download-artifact@v2 - with: - # download all the wheels - path: unmerged - run_id: ${{ github.event.inputs.workflow_id }} - workflow: build_wheels.yml + # with: + # # download all the wheels + # path: unmerged + # run_id: ${{ github.event.inputs.workflow_id }} + # workflow: build_wheels.yml - - name: Merge files to dist - run: | - mkdir dist - mv unmerged/*/*.whl dist + # - name: Merge files to dist + # run: | + # mkdir dist + # mv unmerged/*/*.whl dist - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + # - name: Publish distribution 📦 to PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 From ac5e394e31a99312cce425166b6ea05cf8d38610 Mon Sep 17 00:00:00 2001 From: Maya Taylor Date: Mon, 26 Aug 2024 15:47:09 -0500 Subject: [PATCH 14/22] tmp commit to get action to flush on PR --- .github/workflows/upload_pypi.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/upload_pypi.yml b/.github/workflows/upload_pypi.yml index 9f02a7c5..82f2c9b8 100644 --- a/.github/workflows/upload_pypi.yml +++ b/.github/workflows/upload_pypi.yml @@ -1,5 +1,11 @@ name: Publish wheels to pypi +on: + push: + branches: + - main + pull_request: + # on: # workflow_dispatch: # inputs: From 12ed4719948645253d816257f45cb1aea2e0c51c Mon Sep 17 00:00:00 2001 From: Maya Taylor Date: Mon, 26 Aug 2024 15:48:20 -0500 Subject: [PATCH 15/22] restoring upload action --- .github/workflows/upload_pypi.yml | 44 +++++++++++++------------------ 1 file changed, 19 insertions(+), 25 deletions(-) diff --git a/.github/workflows/upload_pypi.yml b/.github/workflows/upload_pypi.yml index 82f2c9b8..e1aa42a0 100644 --- a/.github/workflows/upload_pypi.yml +++ b/.github/workflows/upload_pypi.yml @@ -1,18 +1,12 @@ name: Publish wheels to pypi on: - push: - branches: - - main - pull_request: - -# on: -# workflow_dispatch: -# inputs: -# workflow_id: -# description: "The workflow ID to pull wheels from" -# required: true -# type: string + workflow_dispatch: + inputs: + workflow_id: + description: "The workflow ID to pull wheels from" + required: true + type: string jobs: publish: @@ -29,16 +23,16 @@ jobs: steps: - name: Download all the dists uses: dawidd6/action-download-artifact@v2 - # with: - # # download all the wheels - # path: unmerged - # run_id: ${{ github.event.inputs.workflow_id }} - # workflow: build_wheels.yml - - # - name: Merge files to dist - # run: | - # mkdir dist - # mv unmerged/*/*.whl dist - - # - name: Publish distribution 📦 to PyPI - # uses: pypa/gh-action-pypi-publish@release/v1 + with: + # download all the wheels + path: unmerged + run_id: ${{ github.event.inputs.workflow_id }} + workflow: build_wheels.yml + + - name: Merge files to dist + run: | + mkdir dist + mv unmerged/*/*.whl dist + + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 From c15d8d2631378cc63dd3897c9034aaefc81ee728 Mon Sep 17 00:00:00 2001 From: Maya Taylor Date: Mon, 26 Aug 2024 16:21:15 -0500 Subject: [PATCH 16/22] adding source dist --- .github/workflows/build_wheels.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 61cdc8bc..37e0c438 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -3,6 +3,20 @@ name: Build wheels on: workflow_dispatch jobs: + build_sdist: + name: Build source distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v4 + with: + name: cibw-sdist + path: dist/*.tar.gz + build_wheels: name: Build wheels on ${{ matrix.os }} runs-on: ${{ matrix.os }} From 3650c7b4372970e0f7ca11b2b9f4cad0036bfef9 Mon Sep 17 00:00:00 2001 From: Maya Taylor Date: Mon, 26 Aug 2024 16:23:11 -0500 Subject: [PATCH 17/22] fetch full depth --- .github/workflows/build_wheels.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 37e0c438..b64d55f1 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -8,6 +8,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # Fetch full history, necessary for git describe in setup.py - name: Build sdist run: pipx run build --sdist From b24c6ce3f41332145934633a3f230b24319183f7 Mon Sep 17 00:00:00 2001 From: Maya Taylor Date: Mon, 26 Aug 2024 16:28:02 -0500 Subject: [PATCH 18/22] adding source dist to upload --- .github/workflows/upload_pypi.yml | 1 + .github/workflows/upload_testpypi.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/upload_pypi.yml b/.github/workflows/upload_pypi.yml index e1aa42a0..82dcc76e 100644 --- a/.github/workflows/upload_pypi.yml +++ b/.github/workflows/upload_pypi.yml @@ -33,6 +33,7 @@ jobs: run: | mkdir dist mv unmerged/*/*.whl dist + mv unmerged/*/*.tar.gz dist - name: Publish distribution 📦 to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/upload_testpypi.yml b/.github/workflows/upload_testpypi.yml index b84e78a0..fc3c23a6 100644 --- a/.github/workflows/upload_testpypi.yml +++ b/.github/workflows/upload_testpypi.yml @@ -33,6 +33,7 @@ jobs: run: | mkdir dist mv unmerged/*/*.whl dist + mv unmerged/*/*.tar.gz dist - name: Publish distribution 📦 to TestPyPI uses: pypa/gh-action-pypi-publish@release/v1 From 9b102c5ceaccb238c9c1adaf1898e537d82c12f5 Mon Sep 17 00:00:00 2001 From: Ritvik Rao Date: Wed, 28 Aug 2024 14:10:01 -0500 Subject: [PATCH 19/22] line break --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index e4cc4847..f313d9c6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ numpy>=1.10.0 greenlet>=3.0.0 -cython>=3.0.0 \ No newline at end of file +cython>=3.0.0 From d45528e50d0b076aa65467e34b43ea97dd546027 Mon Sep 17 00:00:00 2001 From: Maya Taylor Date: Wed, 28 Aug 2024 15:15:01 -0500 Subject: [PATCH 20/22] experiment without github charm token --- .github/workflows/build_wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index b64d55f1..eb96b321 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -41,7 +41,7 @@ jobs: uses: actions/checkout@v4 with: repository: charmplusplus/charm - token: ${{ secrets.GITHUB_TOKEN }} + # token: ${{ secrets.GITHUB_TOKEN }} path: charm_src/charm fetch-depth: 0 # Fetch full history, necessary for commit_str parsing in setup.py From 9494b2a63097f7b953fcc6973f7d0549e7174fce Mon Sep 17 00:00:00 2001 From: Maya Taylor Date: Wed, 28 Aug 2024 15:19:17 -0500 Subject: [PATCH 21/22] cleanup - somehow checkout charm_src got duplicated --- .github/workflows/build_wheels.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index eb96b321..7f877686 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -41,15 +41,6 @@ jobs: uses: actions/checkout@v4 with: repository: charmplusplus/charm - # token: ${{ secrets.GITHUB_TOKEN }} - path: charm_src/charm - fetch-depth: 0 # Fetch full history, necessary for commit_str parsing in setup.py - - - name: Checkout charm_src # is this best practice? should we use a submodule? - uses: actions/checkout@v4 - with: - repository: charmplusplus/charm - token: ${{ secrets.GITHUB_TOKEN }} path: charm_src/charm fetch-depth: 0 # Fetch full history, necessary for commit_str parsing in setup.py From 9e6cf3ff615da149bb79176c36693b499d758b2d Mon Sep 17 00:00:00 2001 From: Maya Taylor Date: Wed, 28 Aug 2024 15:31:43 -0500 Subject: [PATCH 22/22] remove manual requirements installation instructions (handled by pip install) --- docs/install.rst | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/docs/install.rst b/docs/install.rst index 6117d3b7..011fbfa6 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -25,21 +25,14 @@ To install the latest release of Charm4Py, run:: This will install the latest stable release of Charm4Py, using the default underlying Charm++ build (see the `Charm++ manual`_ for more information on the different builds of Charm++). If you want to -use a specific Charm++ build, you can install and build Charm4Py from source. +use a specific Charm++ build, you can install and build Charm4Py from source. Note that the source distribution +is available via "pip install", but the standard from source build process is via "git clone", as outlined below. Installing Charm4Py from source ------------------------------------------------------------ This install process covers the installation of Charm4Py from source. -Before installing, you need the following prerequisites: - - CPython: numpy, greenlet and cython (``pip install numpy>=1.10.0 greenlet>=3.0.0 cython>=3.0.0``) - - PyPy: none - -You can get these prerequisites by running the following command:: - - $ pip install -r requirements.txt - The first step is to clone the Charm4py repository from Git:: $ git clone https://github.com/charmplusplus/charm4py.git