-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Some ignores for backports for typing * Fixing a bunch of unclosed file warnings * Starting on mypy support * Adding MyPy support to PDGID * Full mypy support added to pdgid/functions As a result, anything that supports __int__ can now be used in the functions; this includes Particle directly! * Adding pre-commit changes * Basic types for Particle (with several skips * Fix for extra __main__ being dumped in the wrong place * Fix for Python 2 * Fix for loading from zipfiles * Make typing optional for the ZipApp * Prepare to push ZipApp as well * ZipApp requires Python 3.7+ * ZipApp compression and earlier Python 3 support * Minor optimizations * No need to skip a file that is not present * Change internal table to a set. 100x faster load, faster searches. Fixes #245 * Add GHA badge * Update docs/CHANGELOG.md * Update docs/CHANGELOG.md * Update docs/CHANGELOG.md * Update docs/CHANGELOG.md * Update docs/CHANGELOG.md * Remove old performance addition - not needed with sets! * Mention PDGID works on any SupportsInt Co-authored-by: Eduardo Rodrigues <[email protected]>
- Loading branch information
1 parent
5748d73
commit 0abf3b2
Showing
57 changed files
with
443 additions
and
224 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ omit = | |
# omit this single file | ||
particle/particle/convert.py | ||
particle/__main__.py | ||
|
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 |
---|---|---|
|
@@ -8,14 +8,27 @@ on: | |
- 'v*' | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-python@v1 | ||
- name: set PY | ||
run: echo "::set-env name=PY::$(python --version --version | sha256sum | cut -d' ' -f1)" | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
- uses: pre-commit/[email protected] | ||
|
||
checks: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
- 2.7 | ||
- 3.6 | ||
- 3.5 | ||
- 3.8 | ||
name: Check Python ${{ matrix.python-version }} | ||
steps: | ||
|
@@ -88,12 +101,10 @@ jobs: | |
zipapp: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-python@v1 | ||
with: | ||
python-version: 3.8 | ||
python-version: 3.7 | ||
|
||
- name: Install wheel and sdist requirements | ||
run: python -m pip install "setuptools>=42.0" "setuptools_scm[toml]>=3.4" "wheel" | ||
|
@@ -102,16 +113,36 @@ jobs: | |
run: python setup.py sdist | ||
|
||
- name: Install requirements | ||
run: python -m pip install enum34 pathlib2 importlib_resources attrs hepunits tabulate --target src | ||
|
||
- name: Move enum to prevent name clash | ||
run: mv src/enum src/enum34 | ||
run: python -m pip install attrs hepunits tabulate importlib_resources --target src | ||
|
||
- name: Make ZipApp | ||
run: python -m zipapp -p "/usr/bin/env python" -o ../particle.pyz . | ||
run: python -m zipapp -c -p "/usr/bin/env python3" -m "particle.__main__:main" -o ../particle.pyz . | ||
working-directory: src | ||
|
||
- uses: actions/upload-artifact@v1 | ||
with: | ||
name: ZipApp | ||
path: particle.pyz | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
|
||
- name: Upload Release Asset | ||
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./particle.pyz | ||
asset_name: particle.pyz | ||
asset_content_type: application/zip |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,4 +71,3 @@ docs/_build | |
/src/particle/version.py | ||
/.mypy_cache/* | ||
/pip-wheel-metadata | ||
|
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
graft src | ||
graft src/particle | ||
|
||
global-exclude .env* | ||
global-exclude .git* | ||
|
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
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
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
Oops, something went wrong.