Skip to content

Commit

Permalink
Github action fix (#12)
Browse files Browse the repository at this point in the history
* adapt PlSmallStr syntax

* adopting uv and hatch for venv and testing

* fix yaml syntax error

* github action fix

* requirements improvement

* pin uv version

* version bumps

* add StructChunked::from_series len hint

* simplify tests

* latest cicd actions versions

* updates

* hatch runs by itself

* remove py3.13 support

* git is hard

* git is hard yml fix

* git is still hard

* clippy fix
  • Loading branch information
erichutchins authored Jan 9, 2025
1 parent 9760078 commit be1e1a1
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 52 deletions.
42 changes: 1 addition & 41 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ on:
- master
tags:
- "*"
- "*"
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}


cancel-in-progress: true

permissions:
Expand All @@ -33,18 +30,10 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4

- name: Install uv with cache
uses: astral-sh/setup-uv@v5
- uses: actions/checkout@v4

- name: Install uv with cache
uses: astral-sh/setup-uv@v5
with:
version: "0.5.13"
enable-cache: true
cache-dependency-glob: "uv.lock"
version: "0.5.13"
version: "0.5.16"
enable-cache: true
cache-dependency-glob: "uv.lock"
python-version: ${{ matrix.python-version }}
Expand All @@ -60,34 +49,22 @@ jobs:
run: uv run pytest tests
- uses: mozilla-actions/sccache-action@v0.0.7

- name: Install project
run: uv sync --all-extras --dev

- name: Run tests
run: uv run pytest tests

linux:
runs-on: ubuntu-latest
strategy:
matrix:
target: [x86_64, x86]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.10"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}


args: --release --out dist --find-interpreter
sccache: "true"
sccache: "true"
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
Expand All @@ -101,27 +78,18 @@ jobs:
matrix:
target: [x64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"

python-version: "3.10"

architecture: ${{ matrix.target }}


- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}


args: --release --out dist --find-interpreter
sccache: "true"
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand All @@ -134,22 +102,16 @@ jobs:
matrix:
target: [x86_64, aarch64]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.10"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}


args: --release --out dist --find-interpreter
sccache: "true"
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand All @@ -159,7 +121,6 @@ jobs:
sdist:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
Expand All @@ -180,7 +141,6 @@ jobs:
environment: pypi
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- uses: actions/download-artifact@v3
with:
Expand Down
4 changes: 0 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/maxmind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub struct MaxmindIPResult<'a> {
pub timezone: &'a str,
}

impl<'a> Default for MaxmindIPResult<'a> {
impl Default for MaxmindIPResult<'_> {
fn default() -> Self {
Self {
asnnum: 0,
Expand Down
2 changes: 1 addition & 1 deletion src/spurdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub struct SpurResult<'a> {
pub tag: &'a str,
}

impl<'a> Default for SpurResult<'a> {
impl Default for SpurResult<'_> {
fn default() -> Self {
Self {
client_count: 0.0,
Expand Down
6 changes: 1 addition & 5 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,31 +40,27 @@ impl BuilderWrapper {
b.append_null()
}
},
},
BuilderWrapper::Float32(b) => {
if let AnyValue::Float32(v) = any_value {
b.append_value(v)
} else {
b.append_null()
}
},
},
BuilderWrapper::Float64(b) => {
if let AnyValue::Float64(v) = any_value {
b.append_value(v)
} else {
b.append_null()
}
},
},
BuilderWrapper::String(b) => {
if let AnyValue::String(v) = any_value {
b.append_value(v)
} else {
b.append_null()
}
},
},
BuilderWrapper::Invalid(b) => b.append_null(),
// BuilderWrapper::ListString(b) => {
// if let AnyValue::List(v) = any_value {
Expand Down Expand Up @@ -139,7 +135,7 @@ pub fn create_builders<'a, const N: usize>(
PlSmallStr::from_str(error_name.as_str()),
capacity,
))
}
},
})
.collect()
}

0 comments on commit be1e1a1

Please sign in to comment.