Skip to content

Commit 7f10a50

Browse files
authored
Setup repository (#1)
1 parent db82968 commit 7f10a50

File tree

5 files changed

+209
-3
lines changed

5 files changed

+209
-3
lines changed

.github/workflows/main.yml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: main
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Setup Python
18+
uses: actions/setup-python@v4
19+
with:
20+
python-version: '3.12'
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
27+
- name: Build
28+
run: |
29+
python -m pip install build
30+
python -m build .
31+
32+
- name: Store the distribution packages
33+
uses: actions/upload-artifact@v3
34+
with:
35+
name: python-package-distributions
36+
path: dist/
37+
38+
test:
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Setup Python
44+
uses: actions/setup-python@v4
45+
with:
46+
python-version: '3.12'
47+
48+
- name: Set up Node.js
49+
uses: actions/setup-node@v4
50+
with:
51+
node-version: '20'
52+
53+
- name: Test
54+
run: |
55+
python -m pip install --upgrade pip
56+
pip install ".[test]"
57+
58+
pytest -v \
59+
--junitxml=test-results/junit.xml \
60+
--cov=pyodide-build \
61+
pyodide_build
62+
63+
- uses: codecov/codecov-action@v4
64+
with:
65+
fail_ci_if_error: false
66+
67+
publish:
68+
name: >-
69+
Publish Python 🐍 distribution 📦 to PyPI
70+
needs:
71+
- build
72+
runs-on: ubuntu-latest
73+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
74+
environment:
75+
name: pypi
76+
url: https://pypi.org/p/pyodide-build
77+
permissions:
78+
id-token: write # IMPORTANT: mandatory for trusted publishing
79+
steps:
80+
- name: Download all the dists
81+
uses: actions/download-artifact@v3
82+
with:
83+
name: python-package-distributions
84+
path: dist/
85+
- name: Publish distribution 📦 to PyPI
86+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
*.a
2+
*.o
3+
*.pyc
4+
*.gen.*
5+
*.out.*
6+
7+
*.egg-info/
8+
9+
__pycache__
10+
11+
.docker_home
12+
.hypothesis
13+
.idea
14+
.mozilla
15+
.mypy_cache/
16+
.pytest_cache/
17+
.vscode
18+
.venv*
19+
20+
build
21+
ccache
22+
dist*/
23+
docs/_build/
24+
emsdk/emsdk
25+
geckodriver.log
26+
node_modules
27+
dist/
28+
pyodide-build/**/build.log
29+
xbuildenv/
30+
.pyodide-xbuildenv*

.pre-commit-config.yaml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
default_language_version:
2+
python: "3.12"
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: "v4.6.0"
6+
hooks:
7+
- id: check-added-large-files
8+
- id: check-case-conflict
9+
- id: check-merge-conflict
10+
- id: check-symlinks
11+
- id: check-yaml
12+
exclude: .clang-format
13+
- id: debug-statements
14+
- id: end-of-file-fixer
15+
- id: mixed-line-ending
16+
- id: trailing-whitespace
17+
18+
- repo: https://github.com/astral-sh/ruff-pre-commit
19+
rev: "v0.3.5"
20+
hooks:
21+
- id: ruff
22+
args: [--fix]
23+
- id: ruff-format
24+
25+
- repo: https://github.com/pre-commit/pygrep-hooks
26+
rev: "v1.10.0"
27+
hooks:
28+
- id: python-use-type-annotations
29+
- id: rst-backticks
30+
- id: rst-directive-colons
31+
- id: rst-inline-touching-normal
32+
33+
- repo: https://github.com/shellcheck-py/shellcheck-py
34+
rev: "v0.10.0.1"
35+
hooks:
36+
- id: shellcheck
37+
38+
- repo: https://github.com/codespell-project/codespell
39+
rev: "v2.2.6"
40+
hooks:
41+
- id: codespell
42+
args:
43+
[
44+
"--ignore-words-list",
45+
"ags,aray,asend,ba,classs,crate,falsy,feld,inflight,lits,nd,slowy,te,oint,conveniant",
46+
]
47+
48+
- repo: https://github.com/pre-commit/mirrors-mypy
49+
rev: "v1.10.0"
50+
hooks:
51+
- id: mypy
52+
files: ^(pyodide-build/pyodide_build)
53+
exclude: (.*test.*)
54+
args: []
55+
additional_dependencies: &mypy-deps
56+
- packaging
57+
- types-docutils
58+
- types-pyyaml
59+
- types-setuptools
60+
- types-requests
61+
- numpy
62+
- build
63+
- pytest
64+
- pydantic>=2.0
65+
- unearth
66+
- resolvelib
67+
- rich
68+
- auditwheel_emscripten
69+
- pyodide-lock==0.1.0a5
70+
- id: mypy
71+
name: mypy-tests
72+
args: [--ignore-missing-imports]
73+
files: ^(conftest.py|src/tests|pyodide-build/pyodide_build/tests)
74+
additional_dependencies: *mypy-deps
75+
76+
- repo: https://github.com/pre-commit/mirrors-prettier
77+
rev: "v4.0.0-alpha.8"
78+
hooks:
79+
- id: prettier
80+
81+
ci:
82+
autoupdate_schedule: "quarterly"

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## Unreleased
8+
9+
- pyodide-build is now developed under https://github.com/pyodide/pyodide-build.

pyproject.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ xbuildenv = "pyodide_build.cli.xbuildenv:app"
6060

6161
[project.optional-dependencies]
6262
test = [
63-
# (FIXME: 2024/01/28) The latest pytest-asyncio 0.23.3 is not compatible with pytest 8.0.0
64-
"pytest<8.0.0",
65-
"pytest-pyodide==0.57.0",
63+
"pytest",
6664
"pytest-httpserver",
65+
"pytest-cov",
6766
"packaging",
6867
]
6968

0 commit comments

Comments
 (0)