Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ Doxyfile text
*.pyc binary
*.pyd binary
*.pyo binary
# SCM syntax highlighting & preventing 3-way merges
pixi.lock merge=binary linguist-language=YAML linguist-generated=true
96 changes: 74 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,60 +11,112 @@ on:
pull_request:

jobs:
build:
test:

runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python: ["310", "311", "312", "313"]
sqlalchemy: ["14", "20"]
os: [ubuntu-latest, windows-latest]

steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v2
- uses: prefix-dev/setup-pixi@v0.9.1
with:
python-version: ${{ matrix.python }}
- name: Install tox
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Test with tox
run: tox
pixi-version: v0.49.0
- name: Test
run: pixi run -e py${{ matrix.python }}-sqla${{ matrix.sqlalchemy }} test-cov
- name: Upload codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true

deploy:
lint:

if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:
- uses: actions/checkout@v1
- uses: prefix-dev/setup-pixi@v0.9.1
with:
pixi-version: v0.49.0
- name: Test
run: pixi run lint

build:

runs-on: ubuntu-latest

needs: build
needs: test

steps:
- uses: actions/checkout@v2
- uses: prefix-dev/setup-pixi@v0.9.1
with:
pixi-version: v0.49.0
- name: Build package
run: |
pixi run -e build build
- name: Archive build artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: |
dist

test-build:
name: Test build files
runs-on: ubuntu-latest
needs: build
steps:
- name: Load build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: |
dist

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install wheel
- name: Install local package
run: |
python -m pip install --upgrade pip
pip install wheel
- name: Build package
python -m pip install dist/serialchemy*.whl
- name: Test local package
run: |
python setup.py sdist bdist_wheel
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
python -c "import serialchemy"

pypi-publish:

if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')

name: Publish package PyPI
runs-on: ubuntu-latest
needs: test-build
environment:
name: pypi
url: https://pypi.org/p/serialchemy
permissions:
id-token: write
steps:
- name: Load build artifacts
uses: actions/download-artifact@v4
with:
user: __token__
password: ${{ secrets.pypi_token }}
name: dist
path: |
dist

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

sonarcloud:

Expand Down
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,9 @@ environment.yml

# mypy
.mypy_cache/
# pixi environments
.pixi/*
!.pixi/config.toml

# Generated version file
src/serialchemy/_version.py
32 changes: 5 additions & 27 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,13 @@ Ready to contribute? Here's how to set up `serialchemy` for local development.

$ git clone git@github.com:your_github_username_here/serialchemy.git

#. Create a virtual environment and activate it::
#. Install pixi

$ python -m virtualenv .env
See https://pixi.sh/latest/installation/

$ .env\Scripts\activate # For Windows
$ source .env/bin/activate # For Linux
#. Install pre-commit

#. Install the development dependencies for setting up your fork for local development::

$ cd serialchemy/
$ pip install -e .[testing,docs]

.. note::

If you use ``conda``, you can install ``virtualenv`` in the root environment::

$ conda install -n root virtualenv

Don't worry as this is safe to do.

#. Install pre-commit::

$ pre-commit install
$ pixi run setup

#. Create a branch for local development::

Expand All @@ -50,13 +34,7 @@ Ready to contribute? Here's how to set up `serialchemy` for local development.

#. When you're done making changes, run the tests::

$ pytest

#. If you want to check the modification made on the documentation, you can generate the docs locally::

$ tox -e docs

The documentation files will be generated in ``docs/_build``.
$ pixi run test

#. Commit your changes and push your branch to GitHub::

Expand Down
26 changes: 0 additions & 26 deletions environment.devenv.yml

This file was deleted.

Loading
Loading