Skip to content

Commit

Permalink
CI Workflow updates with working tests (#1)
Browse files Browse the repository at this point in the history
* Switch dependency management to pipenv

* Remove required python version from Pipfile

* Improved test job

* Install pipenv with specific python version

* Drop python 3.6 support

* Add importlib-metadata module

Apparently required by macos

* Cargo cache for test runs

* Add typing-extensions package

* Update installation instructions in README

* rust cache key includes python version
  • Loading branch information
nfrasser committed Mar 10, 2022
1 parent 699dc51 commit 7450d20
Show file tree
Hide file tree
Showing 6 changed files with 237 additions and 13 deletions.
28 changes: 21 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,33 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.6', '3.7', '3.10']
python-version: ['3.7', '3.10']
steps:
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions/checkout@v2
- uses: messense/maturin-action@v1
- uses: actions/cache@v2
with:
command: develop
- uses: psf/black@stable
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-python-${{ matrix.python-version }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install pipenv
run: pipx install pipenv
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- run: pip install -r requirements.txt
- run: pytest
cache: 'pipenv'
- name: pipenv install
run: pipenv install --dev --python ${{ matrix.python-version }}
- run: pipenv run maturin develop
- run: pipenv run pytest

linux:
runs-on: ubuntu-latest
Expand Down
12 changes: 12 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[dev-packages]
black = "*"
maturin = "*"
pytest = "*"
atomicwrites = "*"
importlib-metadata = "*"
typing-extensions = "*"
196 changes: 196 additions & 0 deletions Pipfile.lock

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

9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,20 @@ Option | Description | Type | Default
## Development

1. Install [Rust](https://www.rust-lang.org/tools/install)
1. Install [Python 3](https://www.python.org/downloads/)
1. Install [Python 3.7+](https://www.python.org/downloads/)
1. Install [Pipenv](https://pipenv.pypa.io/en/latest/)
1. Clone this repository and navigate to it via command line
```sh
git clone https://github.com/nfrasser/pyoxipng.git
cd pyoxipng
```
1. Install dependencies
```sh
pip install -r requirements.txt
pipenv install --dev
```
1. Activate the dev environment
```
pipenv shell
```
1. Build
```sh
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "pyoxipng"
requires-python = ">=3.6"
requires-python = ">=3.7"
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Rust",
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt

This file was deleted.

0 comments on commit 7450d20

Please sign in to comment.