Skip to content

Commit 2fcfb29

Browse files
author
FuNK3Y
committed
python-ecosys/aiohttp: Fix partial reads.
0 parents  commit 2fcfb29

File tree

543 files changed

+60439
-0
lines changed

Some content is hidden

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

543 files changed

+60439
-0
lines changed

.github/workflows/build_packages.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build all packages
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
PACKAGE_INDEX_PATH: /tmp/micropython-lib-deploy
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-python@v4
14+
- name: Setup environment
15+
run: source tools/ci.sh && ci_build_packages_setup
16+
- name: Check manifest files
17+
run: source tools/ci.sh && ci_build_packages_check_manifest
18+
- name: Compile package index
19+
run: source tools/ci.sh && ci_build_packages_compile_index
20+
- name: Compile package examples
21+
run: source tools/ci.sh && ci_build_packages_examples
22+
- name: Publish packages for branch
23+
if: vars.MICROPY_PUBLISH_MIP_INDEX && github.event_name == 'push' && ! github.event.deleted
24+
run: source tools/ci.sh && ci_push_package_index
25+
- name: Upload packages as artifact
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: packages-${{ github.sha }}
29+
path: ${{ env.PACKAGE_INDEX_PATH }}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Cleanup published packages
2+
3+
on: delete
4+
5+
jobs:
6+
cleanup:
7+
runs-on: ubuntu-latest
8+
if: vars.MICROPY_PUBLISH_MIP_INDEX
9+
steps:
10+
- uses: actions/checkout@v3
11+
- name: Clean up published files
12+
run: source tools/ci.sh && ci_cleanup_package_index ${{ github.event.ref }}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Check commit message formatting
2+
3+
on: [push, pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: '100'
16+
- uses: actions/setup-python@v4
17+
- name: Check commit message formatting
18+
run: source tools/ci.sh && ci_commit_formatting_run

.github/workflows/package_tests.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Package tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- uses: actions/setup-python@v4
11+
- name: Setup environment
12+
run: source tools/ci.sh && ci_package_tests_setup_micropython
13+
- name: Setup libraries
14+
run: source tools/ci.sh && ci_package_tests_setup_lib
15+
- name: Run tests
16+
run: source tools/ci.sh && ci_package_tests_run

.github/workflows/ruff.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
2+
name: Python code lint and formatting with ruff
3+
on: [push, pull_request]
4+
jobs:
5+
ruff:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
# Version should be kept in sync with .pre-commit_config.yaml & also micropython
10+
- run: pip install --user ruff==0.11.6
11+
- run: ruff check --output-format=github .
12+
- run: ruff format --diff .

.gitignore

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

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: verifygitlog
5+
name: MicroPython git commit message format checker
6+
entry: tools/verifygitlog.py --check-file --ignore-rebase
7+
language: python
8+
verbose: true
9+
stages: [commit-msg]
10+
- repo: https://github.com/charliermarsh/ruff-pre-commit
11+
# Version should be kept in sync with .github/workflows/ruff.yml & also micropython
12+
rev: v0.11.6
13+
hooks:
14+
- id: ruff
15+
id: ruff-format

CODEOFCONDUCT.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Please see the [MicroPython Code of Conduct](https://github.com/micropython/micropython/blob/master/CODEOFCONDUCT.md).

CONTRIBUTING.md

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
## Contributor's Guidelines & Code Conventions
2+
3+
micropython-lib follows the same general conventions as the [main MicroPython
4+
repository](https://github.com/micropython/micropython). Please see
5+
[micropython/CONTRIBUTING.md](https://github.com/micropython/micropython/blob/master/CONTRIBUTING.md)
6+
and [micropython/CODECONVENTIONS.md](https://github.com/micropython/micropython/blob/master/CODECONVENTIONS.md).
7+
8+
### Raising issues
9+
10+
Please include enough information for someone to reproduce the issue you are
11+
describing. This will typically include:
12+
13+
* The version of MicroPython you are using (e.g. the firmware filename, git
14+
hash, or version info printed by the startup message).
15+
* What board/device you are running MicroPython on.
16+
* Which package you have installed, how you installed it, and what version.
17+
When installed via `mip`, all packages will have a `__version__`
18+
attribute.
19+
* A simple code snippet that demonstrates the issue.
20+
21+
If you have a how-to question or are looking for help with using MicroPython
22+
or packages from micropython-lib, please post at the
23+
[discussion forum](https://github.com/orgs/micropython/discussions) instead.
24+
25+
### Pull requests
26+
27+
The same rules for commit messages, signing-off commits, and commit structure
28+
apply [as for the main MicroPython repository](https://github.com/micropython/micropython/blob/master/CODECONVENTIONS.md).
29+
30+
All Python code is formatted using the [black](https://github.com/psf/black)
31+
tool. You can run [`tools/codeformat.py`](tools/codeformat.py) to apply
32+
`black` automatically before submitting a PR. The GitHub CI will also run the
33+
[ruff](https://github.com/astral-sh/ruff) tool to apply further "linting"
34+
checks.
35+
36+
Similar to the main repository, a configuration is provided for the
37+
[pre-commit](https://pre-commit.com/) tool to apply `black` code formatting
38+
rules and run `ruff` automatically. See the documentation for using pre-commit
39+
in [the code conventions document](https://github.com/micropython/micropython/blob/master/CODECONVENTIONS.md#automatic-pre-commit-hooks)
40+
41+
In addition to the conventions from the main repository, there are some
42+
specific conventions and guidelines for micropython-lib:
43+
44+
* The first line of the commit message should start with the name of the
45+
package, followed by a short description of the commit. Package names are
46+
globally unique in the micropython-lib directory structure.
47+
48+
For example: `shutil: Add disk_usage function.`
49+
50+
* Although we encourage keeping the code short and minimal, please still use
51+
comments in your code. Typically, packages will be installed via
52+
`mip` and so they will be compiled to bytecode where comments will
53+
_not_ contribute to the installed size.
54+
55+
* All packages must include a `manifest.py`, including a `metadata()` line
56+
with at least a description and a version.
57+
58+
* Prefer to break larger packages up into smaller chunks, so that just the
59+
required functionality can be installed. The way to do this is to have a
60+
base package, e.g. `mypackage` containing `mypackage/__init__.py`, and then
61+
an "extension" package, e.g. `mypackage-ext` containing additional files
62+
e.g. `mypackage/ext.py`. See
63+
[`collections-defaultdict`](python-stdlib/collections-defaultdict) as an
64+
example.
65+
66+
* If you think a package might be extended in this way in the future, prefer
67+
to create a package directory with `package/__init__.py`, rather than a
68+
single `module.py`.
69+
70+
* Packages in the python-stdlib directory should be CPython compatible and
71+
implement a subset of the CPython equivalent. Avoid adding
72+
MicroPython-specific extensions. Please include a link to the corresponding
73+
CPython docs in the PR.
74+
75+
* Include tests (ideally using the `unittest` package) as `test_*.py`.
76+
Otherwise, provide examples as `example_*.py`. When porting CPython
77+
packages, prefer to use the existing tests rather than writing new ones
78+
from scratch.
79+
80+
* When porting an existing third-party package, please ensure that the source
81+
license is compatible.
82+
83+
* To make it easier for others to install packages directly from your PR before
84+
it is merged, consider opting-in to automatic package publishing (see
85+
[Publishing packages from forks](#publishing-packages-from-forks)). If you do
86+
this, consider quoting the [commands to install
87+
packages](README.md#installing-packages-from-forks) in your Pull Request
88+
description.
89+
90+
### Publishing packages from forks
91+
92+
You can easily publish the packages from your micropython-lib
93+
[fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks)
94+
by opting in to a system based on [GitHub
95+
Actions](https://docs.github.com/en/actions) and [GitHub
96+
Pages](https://docs.github.com/en/pages):
97+
98+
1. Open your fork's repository in the GitHub web interface.
99+
2. Navigate to "Settings" -> "Secrets and variables" -> "Actions" -> "Variables".
100+
3. Click "New repository variable"
101+
4. Create a variable named `MICROPY_PUBLISH_MIP_INDEX` with value `true` (or any
102+
"truthy" value).
103+
5. The settings for GitHub Actions and GitHub Pages features should not need to
104+
be changed from the repository defaults, unless you've explicitly disabled
105+
Actions or Pages in your fork.
106+
107+
The next time you push commits to a branch in your fork, GitHub Actions will run
108+
an additional step in the "Build All Packages" workflow named "Publish Packages
109+
for branch". This step runs in *your fork*, but if you open a pull request then
110+
this workflow is not shown in the Pull Request's "Checks". These run in the
111+
upstream repository. Navigate to your fork's Actions tab in order to see
112+
the additional "Publish Packages for branch" step.
113+
114+
Anyone can then install these packages as described under [Installing packages
115+
from forks](README.md#installing-packages-from-forks).
116+
117+
The exact command is also quoted in the GitHub Actions log in your fork's
118+
Actions for the "Publish Packages for branch" step of "Build All Packages".
119+
120+
#### Opting Back Out
121+
122+
To opt-out again, delete the `MICROPY_PUBLISH_MIP_INDEX` variable and
123+
(optionally) delete the `gh-pages` branch from your fork.
124+
125+
*Note*: While enabled, all micropython-lib packages will be published each time
126+
a change is pushed to any branch in your fork. A commit is added to the
127+
`gh-pages` branch each time. In a busy repository, the `gh-pages` branch may
128+
become quite large. The actual `.git` directory size on disk should still be
129+
quite small, as most of the content will be duplicated. If you're worried that
130+
the `gh-pages` branch has become too large then you can always delete this
131+
branch from GitHub. GitHub Actions will create a new `gh-pages` branch the next
132+
time you push a change.

0 commit comments

Comments
 (0)