Skip to content

Commit

Permalink
Merge branch 'main' into feat-add-copy-ttree
Browse files Browse the repository at this point in the history
  • Loading branch information
jpivarski authored Mar 20, 2024
2 parents 6da95a6 + e727daa commit df2cd16
Show file tree
Hide file tree
Showing 31 changed files with 1,138 additions and 213 deletions.
27 changes: 27 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,33 @@
"contributions": [
"test"
]
},
{
"login": "YSelfTool",
"name": "Robin Sonnabend",
"avatar_url": "https://avatars.githubusercontent.com/u/1640386?v=4",
"profile": "http://tooldev.de",
"contributions": [
"code"
]
},
{
"login": "bojohnson5",
"name": "Bo Johnson",
"avatar_url": "https://avatars.githubusercontent.com/u/20647190?v=4",
"profile": "https://github.com/bojohnson5",
"contributions": [
"code"
]
},
{
"login": "milesgranger",
"name": "Miles",
"avatar_url": "https://avatars.githubusercontent.com/u/13764397?v=4",
"profile": "https://github.com/milesgranger",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ updates:
directory: /
schedule:
interval: weekly
groups:
actions:
patterns:
- '*'
32 changes: 32 additions & 0 deletions .github/workflows/build-distributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build sdist and wheel

on:
# Run on demand with workflow dispatch
workflow_dispatch:
# Use from other workflows
workflow_call:

jobs:
dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build sdist and wheel
run: pipx run build

- name: Check metadata
run: pipx run twine check --strict dist/*

- name: List contents of sdist
run: python -m tarfile --list dist/uproot-*.tar.gz

- name: List contents of wheel
run: python -m zipfile --list dist/uproot-*.whl

- uses: actions/upload-artifact@v4
with:
name: distribution-artifact
path: dist/*
29 changes: 13 additions & 16 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,31 @@ on:
types:
- published

jobs:
dist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build wheel and SDist
run: pipx run build
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

- name: Check metadata
run: pipx run twine check dist/*

- uses: actions/upload-artifact@v4
with:
path: dist/*
jobs:

build_dist:
name: Build and upload sdist and wheel
if: github.repository_owner == 'scikit-hep'
uses: ./.github/workflows/build-distributions.yml

publish:
needs: [dist]
needs: [build_dist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/download-artifact@v4
with:
name: artifact
name: distribution-artifact
path: dist

- name: List distributions to be deployed
run: ls -lha dist/

- uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_password }}
39 changes: 39 additions & 0 deletions .github/workflows/upload-nightly-wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Upload nightly wheels to Anaconda Cloud

on:
# Run daily at 1:23 UTC
schedule:
- cron: 23 1 * * *
# Run on demand with workflow dispatch
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:

build_wheel:
name: Build and upload wheel
if: github.repository_owner == 'scikit-hep'
uses: ./.github/workflows/build-distributions.yml

upload_nightly_wheels:
name: Upload nightly wheels to Anaconda Cloud
needs: [build_wheel]
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v4
with:
name: distribution-artifact
path: dist

- name: List wheel to be deployed
run: ls -lha dist/*.whl

- name: Upload wheel to Anaconda Cloud as nightly
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # 0.5.0
with:
artifacts_path: dist
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }}
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.1.1
rev: 24.2.0
hooks:
- id: black

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.14
rev: v0.2.2
hooks:
- id: ruff
args: [--fix, --show-fixes]


- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.15.1
hooks:
- id: pyupgrade
args: [--py38-plus]
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ Thanks especially to the gracious help of Uproot contributors (including the [or
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/bnavigator"><img src="https://avatars.githubusercontent.com/u/4623504?v=4?s=100" width="100px;" alt="Ben Greiner"/><br /><sub><b>Ben Greiner</b></sub></a><br /><a href="https://github.com/scikit-hep/uproot5/commits?author=bnavigator" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://tooldev.de"><img src="https://avatars.githubusercontent.com/u/1640386?v=4?s=100" width="100px;" alt="Robin Sonnabend"/><br /><sub><b>Robin Sonnabend</b></sub></a><br /><a href="https://github.com/scikit-hep/uproot5/commits?author=YSelfTool" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/bojohnson5"><img src="https://avatars.githubusercontent.com/u/20647190?v=4?s=100" width="100px;" alt="Bo Johnson"/><br /><sub><b>Bo Johnson</b></sub></a><br /><a href="https://github.com/scikit-hep/uproot5/commits?author=bojohnson5" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/milesgranger"><img src="https://avatars.githubusercontent.com/u/13764397?v=4?s=100" width="100px;" alt="Miles"/><br /><sub><b>Miles</b></sub></a><br /><a href="https://github.com/scikit-hep/uproot5/commits?author=milesgranger" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
5 changes: 3 additions & 2 deletions docs-sphinx/prepare_docstrings.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def ensure(filename, content):

def handle_module(modulename, module):
if any(x.startswith("_") for x in modulename.split(".")) and not any(
x == "_dask" for x in modulename.split(".")
x == "_dask" or x == "_dask_write" for x in modulename.split(".")
):
return

Expand All @@ -125,7 +125,8 @@ def handle_module(modulename, module):
toctree2.write(" " + modulename + " (module) <" + modulename + ">\n")

if modulename != "uproot" and all(
not x.startswith("_") or x == "_dask" for x in modulename.split(".")
not x.startswith("_") or x == "_dask" or x == "_dask_write"
for x in modulename.split(".")
):

def good(obj):
Expand Down
27 changes: 15 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ requires = [
"hatch-vcs"
]

[lint.mccabe]
max-complexity = 100

[project]
authors = [
{name = "Jim Pivarski", email = "[email protected]"}
Expand Down Expand Up @@ -35,7 +38,7 @@ classifiers = [
]
dependencies = [
"awkward>=2.4.6",
"importlib-metadata;python_version<\"3.8\"",
"cramjam>=2.5.0",
"numpy",
"fsspec",
"packaging",
Expand All @@ -59,10 +62,12 @@ dev = [
"pandas",
"awkward-pandas"
]
http = ["aiohttp"]
s3 = ["s3fs"]
test = [
"lz4",
"isal",
"deflate",
"xxhash",
"zstandard",
"minio",
"aiohttp",
"fsspec-xrootd",
Expand All @@ -75,6 +80,7 @@ test = [
"scikit-hep-testdata",
"rangehttpserver"
]
xrootd = ["fsspec-xrootd"]

[project.urls]
Download = "https://github.com/scikit-hep/uproot5/releases"
Expand Down Expand Up @@ -114,6 +120,9 @@ exclude = [
"src/uproot/__init__.py",
"docs-sphinx/*.py"
]
src = ["src"]

[tool.ruff.lint]
ignore = [
"E501",
"E722",
Expand All @@ -122,7 +131,7 @@ ignore = [
"SIM118", # key in dict, broken since uproot doesn't behave like a dict
"PGH003", # too-broad type ignore
"SIM114", # combine `if` branches using logical `or` operator
"PGH001", # no eval allowed
"S307", # no eval allowed
"PLC1901", # empty string is falsey (but I don't want to rely on such weak typing)
"RUF012" # enforces type annotations on a codebase that lacks type annotations
]
Expand All @@ -146,16 +155,10 @@ select = [
"UP", # pyupgrade
"YTT" # flake8-2020
]
src = ["src"]

[tool.ruff.lint]
isort.required-imports = ["from __future__ import annotations"]

[tool.ruff.mccabe]
max-complexity = 100

[tool.ruff.per-file-ignores]
"dev/*" = ["T20"]
[tool.ruff.lint.per-file-ignores]
"dev/*" = ["T20", "T201"]
"src/uproot/*/file.py" = ["SIM115"]

[tool.setuptools_scm]
Expand Down
Loading

0 comments on commit df2cd16

Please sign in to comment.