Skip to content

Commit 0ca0546

Browse files
committed
BLD: first commit
0 parents  commit 0ca0546

File tree

6 files changed

+224
-0
lines changed

6 files changed

+224
-0
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Auto detect text files and perform LF normalization
2+
*.py text=auto eol=lf
3+
*.pyx text=auto eol=lf
4+
*.cpp text=auto eol=lf
5+
*.h text=auto eol=lf
6+
*.rst text=auto eol=lf
7+
*.txt text=auto eol=lf
8+
*.yml text=auto eol=lf
9+
*.md text=auto eol=lf

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
scipy-src
2+
dist
3+
4+
.idea/

CONTRIBUTING.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Contributing to the `scipy-release` repository
2+
3+
This repository has fairly strict contribution rules for security and
4+
auditability reasons, as explained in the README. PRs with improvements or bug
5+
fixes are very welcome, however CI jobs will not run for anyone who doesn't
6+
have commit access.
7+
8+
9+
## Running CI jobs on your own fork
10+
11+
To get CI to run on your own fork for changes in a branch named
12+
`my-branch-name`, add a temporary commit to your branch that adds a trigger:
13+
14+
```diff
15+
--- a/.github/workflows/wheels.yml
16+
+++ b/.github/workflows/wheels.yml
17+
@@ -22,6 +22,7 @@ on:
18+
push:
19+
branches:
20+
- main
21+
+ - my-branch-name
22+
workflow_dispatch:
23+
inputs:
24+
environment:
25+
```
26+
If you title the commit, e.g., `DEBUG: run on fork`, it's easy to drop the
27+
commit again once you're done testing and before opening a PR to the
28+
`scipy/scipy-release` repository.
29+
30+
Note that this will run *a lot of jobs*. If you're doing iterative testing,
31+
it's recommended to only select the platform(s) you're interested in like this:
32+
33+
```diff
34+
--- a/.github/workflows/wheels.yml
35+
+++ b/.github/workflows/wheels.yml
36+
@@ -22,6 +22,7 @@ on:
37+
push:
38+
branches:
39+
- main
40+
+ - my-branch-name
41+
workflow_dispatch:
42+
inputs:
43+
environment:
44+
@@ -48,20 +49,8 @@ jobs:
45+
# Github Actions doesn't support pairing matrix values together, let's improvise
46+
# https://github.com/github/feedback/discussions/7835#discussioncomment-1769026
47+
buildplat:
48+
- - [ubuntu-22.04, manylinux_x86_64, ""]
49+
- - [ubuntu-22.04, musllinux_x86_64, ""]
50+
- - [ubuntu-22.04-arm, manylinux_aarch64, ""]
51+
- [ubuntu-22.04-arm, musllinux_aarch64, ""]
52+
- - [macos-13, macosx_x86_64, openblas]
53+
-
54+
- # targeting macos >= 14. Could probably build on macos-14, but it would be a cross-compile
55+
- - [macos-13, macosx_x86_64, accelerate]
56+
- - [macos-14, macosx_arm64, openblas]
57+
- - [macos-14, macosx_arm64, accelerate]
58+
- - [windows-2022, win_amd64, ""]
59+
- - [windows-2022, win32, ""]
60+
- - [windows-11-arm, win_arm64, ""]
61+
- python: ["cp311", "cp312", "cp313", "cp313t", "cp314", "cp314t", "pp311"]
62+
+ python: ["cp314", "cp314t"]
63+
exclude:
64+
# Don't build PyPy 32-bit windows
65+
- buildplat: [windows-2022, win32, ""]
66+
```
67+
68+
69+
## Commit messages and linear history
70+
71+
Please use the same [commit message format as for the main `scipy` repository](https://numpy.org/devdocs/dev/development_workflow.html#writing-the-commit-message).
72+
73+
This repository requires linear history. It's preferred that contributors edit
74+
their commit history so the PRs they submit contain clean, independent commits.
75+
Note that each commit should be able to pass CI - if one commit depends on
76+
another, they should be merged. Maintainers may decide to squash-merge if those
77+
requirements aren't met.

LICENSE.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Copyright (c) 2001-2002 Enthought, Inc. 2003, SciPy Developers.
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions
6+
are met:
7+
8+
1. Redistributions of source code must retain the above copyright
9+
notice, this list of conditions and the following disclaimer.
10+
11+
2. Redistributions in binary form must reproduce the above
12+
copyright notice, this list of conditions and the following
13+
disclaimer in the documentation and/or other materials provided
14+
with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived
18+
from this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# SciPy wheels and release tooling
2+
3+
This repository contains what is needed to build release artifacts (wheels and
4+
sdist) for the official [SciPy releases to
5+
PyPI](https://pypi.org/project/scipy/) as well as nightly wheel builds which
6+
are uploaded to
7+
[anaconda.org/scientific-python-nightly-wheels/scipy](https://anaconda.org/scientific-python-nightly-wheels/scipy).
8+
9+
This repository is minimal on purpose, for security reasons it contains only what is absolutely necessary. The repository settings are stricter than on the main [scipy/scipy](https://github.com/scipy/scipy/) repository, for example:
10+
11+
- only the release & CI team has write access
12+
- for PRs from anyone without write access, CI will always need manual approval
13+
- linear history is required
14+
- GitHub actions are whitelisted, only the necessary ones will be allowed
15+
- no caching allowed, only clean builds from scratch
16+
- no self-hosted runners are allowed
17+
18+
See [numpy#29178](https://github.com/numpy/numpy/issues/29178) for more context.
19+
20+
21+
## Branches and tags
22+
23+
The `main` branch of this repository is meant to stay in sync with the `main` branch
24+
of the [scipy/scipy](https://github.com/scipy/scipy) repository. It runs scheduled builds
25+
as cron jobs twice a week, and uploads nightlies to
26+
[https://anaconda.org/scientific-python-nightly-wheels/scipy](anaconda.org/scientific-python-nightly-wheels/scipy).
27+
28+
For SciPy releases, the branch naming should match those of the main
29+
`scipy/scipy` repository, e.g., `maintenance/2.3.x` for the 2.3.x releases.
30+
31+
Which branch, commit or tag is built when a set of wheel builds is triggered is
32+
controlled by the `SOURCE_REF_TO_BUILD` variable at the top of
33+
`.github/workflows/wheels.yml`.
34+
35+
36+
## Build reproducibility
37+
38+
Wheel builds being fully reproducible is a long-term goal for this repository.
39+
All dependencies and actions must be pinned, which allows us to already be
40+
close to full reproducibility. However, we don't (yet) have full control over
41+
all ingredients that go into a wheel build, e.g. the containers which GitHub
42+
Actions provide may change over time.
43+
44+
45+
## Trusted publishing and attestations
46+
47+
The release builds in this repository should be using trusted publishing to
48+
publish directly to PyPI (and TestPyPI), including attestations. Triggering
49+
a release build has to be done by the `workflow_dispatch` in the
50+
[Actions UI in this repository](https://github.com/scipy/scipy-release/actions/workflows/wheels.yml),
51+
selecting `pypi` or `testpypi` as the target. This will use a GitHub Actions
52+
"environment" of the same name - before the uploads to PyPI actually happen,
53+
the release manager can go in and inspect the build logs and produced wheels.
54+
Once those look good, the release manager can finalize the release from the
55+
[deployments page in this repository](https://github.com/scipy/scipy-release/deployments).
56+
57+
58+
## Software Bill of Materials
59+
60+
We aim to start producing SBOMs and ship them inside SciPy wheels uploaded to
61+
PyPI, however as of today that is not implemented.
62+
63+
64+
## Security
65+
66+
To report a security vulnerability for SciPy itself, please see
67+
[the security policy on the main repo](https://github.com/numpy/numpy/?tab=security-ov-file#readme).
68+
69+
To discuss a supply chain security related topic for the code in this
70+
repository, please open an issue on this repository if it can be discussed in
71+
public, and otherwise please follow the security policy on the main repo.

cibuildwheel.toml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[tool.cibuildwheel]
2+
skip = ["*_i686", "*_ppc64le", "*_s390x", "*_universal2"]
3+
# We're only testing with essential test dependencies, not optional ones.
4+
# Some of those require binary wheels (often missing for some platforms),
5+
# or they slow down the test suite runs too much or simply aren't necessary.
6+
test-requires = [
7+
"pytest",
8+
"pytest-xdist",
9+
"threadpoolctl",
10+
"pooch",
11+
"hypothesis",
12+
]
13+
before-build = "bash {project}/tools/wheels/cibw_before_build.sh {project}"
14+
test-command = "bash {project}/tools/wheels/cibw_test_command.sh {project}"
15+
16+
[tool.cibuildwheel.linux]
17+
manylinux-x86_64-image = "manylinux_2_28"
18+
manylinux-aarch64-image = "manylinux_2_28"
19+
musllinux-x86_64-image = "musllinux_1_2"
20+
musllinux-aarch64-image = "musllinux_1_2"
21+
22+
[tool.cibuildwheel.linux.environment]
23+
# RUNNER_OS is a GitHub Actions specific env var; define it here so it's
24+
# defined when running cibuildwheel locally
25+
RUNNER_OS="Linux"
26+
# /project will be the $PWD equivalent inside the Docker container used to build the wheel
27+
PKG_CONFIG_PATH="/project/.openblas"
28+
29+
[tool.cibuildwheel.macos.environment]
30+
PKG_CONFIG_PATH = "{project}"
31+
32+
[tool.cibuildwheel.windows]
33+
repair-wheel-command = "bash ./tools/wheels/repair_windows.sh {wheel} {dest_dir}"

0 commit comments

Comments
 (0)