From 7450d206f819b099986dd0dcf35f1935504ac914 Mon Sep 17 00:00:00 2001 From: Nick Frasser Date: Thu, 10 Mar 2022 18:31:30 -0500 Subject: [PATCH] CI Workflow updates with working tests (#1) * 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 --- .github/workflows/CI.yml | 28 ++++-- Pipfile | 12 +++ Pipfile.lock | 196 +++++++++++++++++++++++++++++++++++++++ README.md | 9 +- pyproject.toml | 2 +- requirements.txt | 3 - 6 files changed, 237 insertions(+), 13 deletions(-) create mode 100644 Pipfile create mode 100644 Pipfile.lock delete mode 100644 requirements.txt diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a7d4beb..6f96e9b 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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 diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..345f041 --- /dev/null +++ b/Pipfile @@ -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 = "*" diff --git a/Pipfile.lock b/Pipfile.lock new file mode 100644 index 0000000..81116d4 --- /dev/null +++ b/Pipfile.lock @@ -0,0 +1,196 @@ +{ + "_meta": { + "hash": { + "sha256": "ea794208e88d9f2e7e6c6577178a95baf0b57105daca98a8dc4ea1c20cca97d4" + }, + "pipfile-spec": 6, + "requires": {}, + "sources": [ + { + "name": "pypi", + "url": "https://pypi.org/simple", + "verify_ssl": true + } + ] + }, + "default": {}, + "develop": { + "atomicwrites": { + "hashes": [ + "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197", + "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a" + ], + "index": "pypi", + "version": "==1.4.0" + }, + "attrs": { + "hashes": [ + "sha256:2d27e3784d7a565d36ab851fe94887c5eccd6a463168875832a1be79c82828b4", + "sha256:626ba8234211db98e869df76230a137c4c40a12d72445c45d5f5b716f076e2fd" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==21.4.0" + }, + "black": { + "hashes": [ + "sha256:07e5c049442d7ca1a2fc273c79d1aecbbf1bc858f62e8184abe1ad175c4f7cc2", + "sha256:0e21e1f1efa65a50e3960edd068b6ae6d64ad6235bd8bfea116a03b21836af71", + "sha256:1297c63b9e1b96a3d0da2d85d11cd9bf8664251fd69ddac068b98dc4f34f73b6", + "sha256:228b5ae2c8e3d6227e4bde5920d2fc66cc3400fde7bcc74f480cb07ef0b570d5", + "sha256:2d6f331c02f0f40aa51a22e479c8209d37fcd520c77721c034517d44eecf5912", + "sha256:2ff96450d3ad9ea499fc4c60e425a1439c2120cbbc1ab959ff20f7c76ec7e866", + "sha256:3524739d76b6b3ed1132422bf9d82123cd1705086723bc3e235ca39fd21c667d", + "sha256:35944b7100af4a985abfcaa860b06af15590deb1f392f06c8683b4381e8eeaf0", + "sha256:373922fc66676133ddc3e754e4509196a8c392fec3f5ca4486673e685a421321", + "sha256:5fa1db02410b1924b6749c245ab38d30621564e658297484952f3d8a39fce7e8", + "sha256:6f2f01381f91c1efb1451998bd65a129b3ed6f64f79663a55fe0e9b74a5f81fd", + "sha256:742ce9af3086e5bd07e58c8feb09dbb2b047b7f566eb5f5bc63fd455814979f3", + "sha256:7835fee5238fc0a0baf6c9268fb816b5f5cd9b8793423a75e8cd663c48d073ba", + "sha256:8871fcb4b447206904932b54b567923e5be802b9b19b744fdff092bd2f3118d0", + "sha256:a7c0192d35635f6fc1174be575cb7915e92e5dd629ee79fdaf0dcfa41a80afb5", + "sha256:b1a5ed73ab4c482208d20434f700d514f66ffe2840f63a6252ecc43a9bc77e8a", + "sha256:c8226f50b8c34a14608b848dc23a46e5d08397d009446353dad45e04af0c8e28", + "sha256:ccad888050f5393f0d6029deea2a33e5ae371fd182a697313bdbd835d3edaf9c", + "sha256:dae63f2dbf82882fa3b2a3c49c32bffe144970a573cd68d247af6560fc493ae1", + "sha256:e2f69158a7d120fd641d1fa9a921d898e20d52e44a74a6fbbcc570a62a6bc8ab", + "sha256:efbadd9b52c060a8fc3b9658744091cb33c31f830b3f074422ed27bad2b18e8f", + "sha256:f5660feab44c2e3cb24b2419b998846cbb01c23c7fe645fee45087efa3da2d61", + "sha256:fdb8754b453fb15fad3f72cd9cad3e16776f0964d67cf30ebcbf10327a3777a3" + ], + "index": "pypi", + "version": "==22.1.0" + }, + "click": { + "hashes": [ + "sha256:6a7a62563bbfabfda3a38f3023a1db4a35978c0abd76f6c9605ecd6554d6d9b1", + "sha256:8458d7b1287c5fb128c90e23381cf99dcde74beaf6c7ff6384ce84d6fe090adb" + ], + "markers": "python_version >= '3.6'", + "version": "==8.0.4" + }, + "importlib-metadata": { + "hashes": [ + "sha256:b36ffa925fe3139b2f6ff11d6925ffd4fa7bc47870165e3ac260ac7b4f91e6ac", + "sha256:d16e8c1deb60de41b8e8ed21c1a7b947b0bc62fab7e1d470bcdf331cea2e6735" + ], + "index": "pypi", + "version": "==4.11.2" + }, + "iniconfig": { + "hashes": [ + "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3", + "sha256:bc3af051d7d14b2ee5ef9969666def0cd1a000e121eaea580d4a313df4b37f32" + ], + "version": "==1.1.1" + }, + "maturin": { + "hashes": [ + "sha256:10b4115bdbef3d7c4a71b3a64e76ab9a5643e18aeeff1701464d0a806912f420", + "sha256:11340f1a7cd9f87bc661611d12f046fdd15efc7060fdb5a962afe7031f553b21", + "sha256:195f11b3535ce31ec0c2349fc1f8907e82f99f0e6029b91eaa90ad190e54dd55", + "sha256:28967fe20ccd49f42ba1e72983af962ddb3ab3006ad5422a42ec9e7507072234", + "sha256:2e3065bec67843e72cc77e2abcef223773f5155316b8c4aa80acf04154897521", + "sha256:3bd8f089c9f1975675002c9db6522e6f94c626ae9cee1738f301bd3d66ca4557", + "sha256:3e129a24313345fe48f11678a307bf38dbd23adeb37783493675ffd352cd43ab", + "sha256:3e24fbeaf396f39fc9a58a5853bcc786a922f7bcdf2a773b0e98ab8b56c14ea5", + "sha256:5731481f4793888293a982a9afd9d440f4c3290b010afad2400e39676f073536", + "sha256:734f713d82ad2f650d64beee45f2608ae2c931d69326936c78a2f25f2e189a12", + "sha256:817e5a4b76432aab1e091d56abc71e9b530e1345c036fcbd4cc2b5434f67c28a", + "sha256:970d075dffaae48a41f1ce4d046e16b249d0f621ce5b630fcc2934a86e844fc3", + "sha256:b22556c8ea2fba426269b77c780d89ea52de4ea570eaadbc4a66821533fd5c2b", + "sha256:bc2673b40e50ec60925627ef25fdf8b725238eb79ce2ebc8e84bb245d92d3340", + "sha256:c66e0f1258d3306f2d1c84d032052c5c69cc9306206c3c2fbec0b7e768377141", + "sha256:db61911e65be1f98defe99dcaec021cb77fd3fa98b08deb884c2e4f61e60497a", + "sha256:f8cc9e10718c4959b9438285d97e4ca08e7e75af06bf08c949905dbf427427ee" + ], + "index": "pypi", + "version": "==0.12.10" + }, + "mypy-extensions": { + "hashes": [ + "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d", + "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8" + ], + "version": "==0.4.3" + }, + "packaging": { + "hashes": [ + "sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb", + "sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522" + ], + "markers": "python_version >= '3.6'", + "version": "==21.3" + }, + "pathspec": { + "hashes": [ + "sha256:7d15c4ddb0b5c802d161efc417ec1a2558ea2653c2e8ad9c19098201dc1c993a", + "sha256:e564499435a2673d586f6b2130bb5b95f04a3ba06f81b8f895b651a3c76aabb1" + ], + "version": "==0.9.0" + }, + "platformdirs": { + "hashes": [ + "sha256:7535e70dfa32e84d4b34996ea99c5e432fa29a708d0f4e394bbcb2a8faa4f16d", + "sha256:bcae7cab893c2d310a711b70b24efb93334febe65f8de776ee320b517471e227" + ], + "markers": "python_version >= '3.7'", + "version": "==2.5.1" + }, + "pluggy": { + "hashes": [ + "sha256:4224373bacce55f955a878bf9cfa763c1e360858e330072059e10bad68531159", + "sha256:74134bbf457f031a36d68416e1509f34bd5ccc019f0bcc952c7b909d06b37bd3" + ], + "markers": "python_version >= '3.6'", + "version": "==1.0.0" + }, + "py": { + "hashes": [ + "sha256:51c75c4126074b472f746a24399ad32f6053d1b34b68d2fa41e558e6f4a98719", + "sha256:607c53218732647dff4acdfcd50cb62615cedf612e72d1724fb1a0cc6405b378" + ], + "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", + "version": "==1.11.0" + }, + "pyparsing": { + "hashes": [ + "sha256:18ee9022775d270c55187733956460083db60b37d0d0fb357445f3094eed3eea", + "sha256:a6c06a88f252e6c322f65faf8f418b16213b51bdfaece0524c1c1bc30c63c484" + ], + "markers": "python_version >= '3.6'", + "version": "==3.0.7" + }, + "pytest": { + "hashes": [ + "sha256:9ce3ff477af913ecf6321fe337b93a2c0dcf2a0a1439c43f5452112c1e4280db", + "sha256:e30905a0c131d3d94b89624a1cc5afec3e0ba2fbdb151867d8e0ebd49850f171" + ], + "index": "pypi", + "version": "==7.0.1" + }, + "tomli": { + "hashes": [ + "sha256:939de3e7a6161af0c887ef91b7d41a53e7c5a1ca976325f429cb46ea9bc30ecc", + "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f" + ], + "markers": "python_version < '3.11'", + "version": "==2.0.1" + }, + "typing-extensions": { + "hashes": [ + "sha256:1a9462dcc3347a79b1f1c0271fbe79e844580bb598bafa1ed208b94da3cdcd42", + "sha256:21c85e0fe4b9a155d0799430b0ad741cdce7e359660ccbd8b530613e8df88ce2" + ], + "index": "pypi", + "version": "==4.1.1" + }, + "zipp": { + "hashes": [ + "sha256:9f50f446828eb9d45b267433fd3e9da8d801f614129124863f9c51ebceafb87d", + "sha256:b47250dd24f92b7dd6a0a8fc5244da14608f3ca90a5efcd37a3b1642fac9a375" + ], + "markers": "python_version >= '3.7'", + "version": "==3.7.0" + } + } +} diff --git a/README.md b/README.md index 2ff5be1..a081ef0 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,8 @@ 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 @@ -82,7 +83,11 @@ Option | Description | Type | Default ``` 1. Install dependencies ```sh - pip install -r requirements.txt + pipenv install --dev + ``` +1. Activate the dev environment + ``` + pipenv shell ``` 1. Build ```sh diff --git a/pyproject.toml b/pyproject.toml index 0e6d1a2..61bb1ea 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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", diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 3dc265f..0000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -black -maturin -pytest