Skip to content

Commit fe9d66e

Browse files
committed
first commit
0 parents  commit fe9d66e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+6142
-0
lines changed

.github/workflows/document.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Deployment of documentation
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
doc:
13+
name: Build documentation
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v6
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v6
23+
with:
24+
python-version: '3.12'
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install setuptools wheel build cython
30+
python -m pip install sphinx sphinx-rtd-theme myst-parser
31+
32+
- name: Build wheel and source tarball
33+
run: |
34+
python -m build
35+
36+
- name: Install built wheel
37+
run: |
38+
python -m pip install dist/softfloatpy-*.whl
39+
40+
- name: Build Sphinx documentation
41+
run: |
42+
python -m pip install dist/softfloatpy-*.whl
43+
sphinx-apidoc -T -f -o ./python/docs/source/apidoc ./python/src
44+
sphinx-build -b html ./python/docs/source ./python/docs/build/html
45+
46+
- name: Upload documentation artifact
47+
uses: actions/upload-pages-artifact@v3
48+
with:
49+
path: ./python/docs/build/html
50+
51+
doc-deploy:
52+
name: Deploy documentation
53+
54+
needs:
55+
- doc
56+
57+
permissions:
58+
pages: write
59+
id-token: write
60+
61+
environment:
62+
name: github-pages
63+
url: ${{ steps.deployment.outputs.page_url }}
64+
65+
runs-on: ubuntu-latest
66+
67+
steps:
68+
- name: Deploy documentation to GitHub Pages
69+
id: deployment
70+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Release of packages
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
dist:
10+
name: Release distribution packages
11+
12+
strategy:
13+
matrix:
14+
os:
15+
- ubuntu-24.04
16+
- ubuntu-24.04-arm
17+
- macos-15
18+
- macos-15-intel
19+
- windows-2025
20+
- windows-11-arm
21+
python-version:
22+
- '3.11'
23+
- '3.12'
24+
- '3.13'
25+
26+
runs-on: ${{ matrix.os }}
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v6
31+
32+
- name: Set up Python
33+
uses: actions/setup-python@v6
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
37+
- name: Install dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
python -m pip install setuptools wheel build cython
41+
42+
- name: Build wheel and source tarball
43+
run: |
44+
python -m build
45+
46+
- name: Store distribution
47+
uses: actions/upload-artifact@v6
48+
with:
49+
name: python-package-distributions
50+
path: dist/
51+
52+
pypi:
53+
name: Publish distribution
54+
55+
needs:
56+
- dist
57+
58+
runs-on: ubuntu-latest
59+
60+
environment:
61+
name: pypi
62+
url: https://pypi.org/p/softfloatpy
63+
64+
permissions:
65+
id-token: write # IMPORTANT: mandatory for trusted publishing
66+
67+
steps:
68+
- name: Download distribution
69+
uses: actions/download-artifact@v7
70+
with:
71+
name: python-package-distributions
72+
path: dist/
73+
74+
- name: Publish distribution to PyPI
75+
uses: pypa/gh-action-pypi-publish@release/v1
76+
77+
github-release:
78+
needs:
79+
- dist
80+
81+
runs-on: ubuntu-latest
82+
83+
permissions:
84+
contents: write # IMPORTANT: mandatory for making GitHub Releases
85+
id-token: write # IMPORTANT: mandatory for sigstore
86+
87+
steps:
88+
- name: Download distribution
89+
uses: actions/download-artifact@v7
90+
with:
91+
name: python-package-distributions
92+
path: dist/
93+
94+
- name: Sign distribution with Sigstore
95+
uses: sigstore/[email protected]
96+
with:
97+
inputs: ./dist/*.tar.gz ./dist/*.whl
98+
99+
- name: Upload artifact signatures to GitHub Release
100+
env:
101+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102+
# Upload to GitHub Release using the `gh` CLI.
103+
# `dist/` contains the built packages, and the
104+
# sigstore-produced signatures and certificates.
105+
run: |
106+
gh release upload '${{ github.ref_name }}' dist/** --repo '${{ github.repository }}' --clobber

.github/workflows/test.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Tests of codes
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- develop
8+
pull_request:
9+
branches:
10+
- main
11+
- develop
12+
13+
jobs:
14+
test:
15+
name: Test
16+
17+
strategy:
18+
matrix:
19+
os:
20+
- ubuntu-24.04
21+
- ubuntu-24.04-arm
22+
- macos-15
23+
- macos-15-intel
24+
- windows-2025
25+
- windows-11-arm
26+
python-version:
27+
- '3.11'
28+
- '3.12'
29+
- '3.13'
30+
31+
runs-on: ${{ matrix.os }}
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v6
36+
37+
- name: Set up Python
38+
uses: actions/setup-python@v6
39+
with:
40+
python-version: ${{ matrix.python-version }}
41+
42+
- name: Install dependencies
43+
run: |
44+
python -m pip install --upgrade pip
45+
python -m pip install setuptools wheel build cython
46+
python -m pip install flake8, mypy, pytest
47+
48+
- name: Build wheel and source tarball
49+
run: |
50+
python -m build
51+
52+
- name: Install built wheel
53+
run: |
54+
python -m pip install dist/softfloatpy-*.whl
55+
56+
- name: Check coding style with flake8
57+
run: |
58+
python -m flake8 --doctests ./python
59+
60+
- name: Check data types with mypy
61+
run: |
62+
python -m mypy --strict ./python
63+
64+
- name: Test code with pytest
65+
run: |
66+
python -m pytest ./python --doctest-modules

.github/workflows/testpypi.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Upload of packages to TestPyPI
2+
3+
on:
4+
workflow_dispatch:
5+
branches:
6+
- main
7+
8+
jobs:
9+
dist:
10+
name: Release distribution packages
11+
12+
strategy:
13+
matrix:
14+
os:
15+
- ubuntu-24.04
16+
- ubuntu-24.04-arm
17+
- macos-15
18+
- macos-15-intel
19+
- windows-2025
20+
- windows-11-arm
21+
python-version:
22+
- '3.11'
23+
- '3.12'
24+
- '3.13'
25+
26+
runs-on: ${{ matrix.os }}
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v6
31+
32+
- name: Set up Python
33+
uses: actions/setup-python@v6
34+
with:
35+
python-version: ${{ matrix.python-version }}
36+
37+
- name: Install dependencies
38+
run: |
39+
python -m pip install --upgrade pip
40+
python -m pip install setuptools wheel build cython
41+
42+
- name: Build wheel and source tarball
43+
run: |
44+
python -m build
45+
46+
- name: Store distribution
47+
uses: actions/upload-artifact@v6
48+
with:
49+
name: python-package-distributions
50+
path: dist/
51+
52+
testpypi:
53+
name: Publish test distribution
54+
55+
needs:
56+
- dist
57+
58+
runs-on: ubuntu-latest
59+
60+
environment:
61+
name: testpypi
62+
url: https://test.pypi.org/p/softfloatpy
63+
64+
permissions:
65+
id-token: write # IMPORTANT: mandatory for trusted publishing
66+
67+
steps:
68+
- name: Download distribution
69+
uses: actions/download-artifact@v7
70+
with:
71+
name: python-package-distributions
72+
path: dist/
73+
74+
- name: Publish distribution to TestPyPI
75+
uses: pypa/gh-action-pypi-publish@release/v1
76+
with:
77+
repository-url: https://test.pypi.org/legacy/

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/dist/
2+
__pycache__/
3+
.pytest_cache/
4+
.mypy_cache/
5+
*.egg-info/
6+
*.o
7+
*.obj

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "extern/berkeley-softfloat-3"]
2+
path = extern/berkeley-softfloat-3
3+
url = https://github.com/ucb-bar/berkeley-softfloat-3.git

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"python.analysis.extraPaths": [
3+
"./python/src"
4+
],
5+
"makefile.configureOnOpen": false
6+
}

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
SoftFloatPy: A Python binding of Berkeley SoftFloat.
2+
3+
Copyright (c) 2024-2025 Arihiro Yoshida. All rights reserved.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)