-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #209 from Ousret/3.0
Version 3.0.0rc1
- Loading branch information
Showing
38 changed files
with
933 additions
and
509 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: MYPYC Run | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
detection_coverage: | ||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"] | ||
os: [ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
pip install -U pip setuptools | ||
pip install -r dev-requirements.txt | ||
pip uninstall -y charset-normalizer | ||
- name: Install the package | ||
env: | ||
CHARSET_NORMALIZER_USE_MYPYC: '1' | ||
run: | | ||
python -m build --no-isolation | ||
pip install ./dist/*.whl | ||
- name: Clone the complete dataset | ||
run: | | ||
git clone https://github.com/Ousret/char-dataset.git | ||
- name: Coverage WITH preemptive | ||
run: | | ||
python ./bin/coverage.py --coverage 97 --with-preemptive | ||
- name: Coverage WITHOUT preemptive | ||
run: | | ||
python ./bin/coverage.py --coverage 95 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,8 @@ jobs: | |
pip uninstall -y charset-normalizer | ||
- name: Install the package | ||
run: | | ||
python setup.py install | ||
python -m build | ||
pip install ./dist/*.whl | ||
- name: Type checking (Mypy) | ||
run: | | ||
mypy charset_normalizer | ||
|
@@ -51,7 +52,7 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [ 3.6, 3.7, 3.8, 3.9, "3.10" ] | ||
python-version: [ 3.6, 3.7, 3.8, 3.9, "3.10", "3.11-dev" ] | ||
os: [ ubuntu-latest ] | ||
|
||
steps: | ||
|
@@ -67,7 +68,8 @@ jobs: | |
pip uninstall -y charset-normalizer | ||
- name: Install the package | ||
run: | | ||
python setup.py install | ||
python -m build | ||
pip install ./dist/*.whl | ||
- name: Run tests | ||
run: | | ||
pytest | ||
|
@@ -96,7 +98,8 @@ jobs: | |
pip uninstall -y charset-normalizer | ||
- name: Install the package | ||
run: | | ||
python setup.py install | ||
python -m build | ||
pip install ./dist/*.whl | ||
- name: Clone the complete dataset | ||
run: | | ||
git clone https://github.com/Ousret/char-dataset.git | ||
|
@@ -136,7 +139,8 @@ jobs: | |
pip uninstall -y charset-normalizer | ||
- name: Install the package | ||
run: | | ||
python setup.py install | ||
python -m build | ||
pip install ./dist/*.whl | ||
- name: Clone the complete dataset | ||
run: | | ||
git clone https://github.com/Ousret/char-dataset.git | ||
|
@@ -146,11 +150,92 @@ jobs: | |
- name: Integration Tests with Requests | ||
run: | | ||
python ./bin/integration.py | ||
universal-wheel: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- integration | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: Update pip, setuptools, wheel and twine | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build Wheel | ||
env: | ||
CHARSET_NORMALIZER_USE_MYPYC: '0' | ||
run: python -m build | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
|
||
build-wheels: | ||
name: Build wheels on ${{ matrix.os }} ${{ matrix.qemu }} | ||
runs-on: ${{ matrix.os }}-latest | ||
needs: universal-wheel | ||
strategy: | ||
matrix: | ||
os: [ ubuntu, windows, macos ] | ||
qemu: [ '' ] | ||
include: | ||
# Split ubuntu job for the sake of speed-up | ||
- os: ubuntu | ||
qemu: aarch64 | ||
- os: ubuntu | ||
qemu: ppc64le | ||
- os: ubuntu | ||
qemu: s390x | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Set up QEMU | ||
if: ${{ matrix.qemu }} | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: all | ||
id: qemu | ||
- name: Prepare emulation | ||
run: | | ||
if [[ -n "${{ matrix.qemu }}" ]]; then | ||
# Build emulated architectures only if QEMU is set, | ||
# use default "auto" otherwise | ||
echo "CIBW_ARCHS_LINUX=${{ matrix.qemu }}" >> $GITHUB_ENV | ||
fi | ||
shell: bash | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
- name: Update pip, wheel, setuptools, build, twine | ||
run: | | ||
python -m pip install -U pip wheel setuptools build twine | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD_FRONTEND: "build" | ||
CIBW_ARCHS_MACOS: x86_64 arm64 universal2 | ||
CIBW_ENVIRONMENT: CHARSET_NORMALIZER_USE_MYPYC='1' | ||
CIBW_CONFIG_SETTINGS: "--no-isolation" | ||
CIBW_BEFORE_BUILD: pip install -r dev-requirements.txt | ||
CIBW_TEST_REQUIRES: pytest codecov pytest-cov | ||
CIBW_TEST_COMMAND: pytest {package}/tests | ||
CIBW_SKIP: pp* | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: ./wheelhouse/*.whl | ||
|
||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
needs: | ||
- integration | ||
- build-wheels | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -162,10 +247,17 @@ jobs: | |
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
- name: Download disctributions | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: dist | ||
path: dist | ||
- name: Collected dists | ||
run: | | ||
tree dist | ||
- name: Publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.