Skip to content

Commit

Permalink
Update CI config
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Jan 26, 2024
1 parent 8c12d50 commit 683aa81
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
20 changes: 12 additions & 8 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,28 @@ You can (and should) run our test suite using [*tox*].
However, you’ll probably want a more traditional environment as well.

First, create a [virtual environment](https://virtualenv.pypa.io/) so you don't break your system-wide Python installation.
We recommend using the Python version from the `.python-version` file in project's root directory.
We recommend using the Python version from the `.python-version-default` file in project's root directory.

If you're using [*direnv*](https://direnv.net), you can automate the creation of a virtual environment with the correct Python version by adding the following `.envrc` to the project root:
If you're using [*direnv*](https://direnv.net), you can automate the creation of a virtual environment with the correct Python version by adding the following `.envrc` to the project root after you've cloned it to your computer:

```bash
layout python python$(cat .python-version)
layout python python$(cat .python-version-default)
```

Next, get an up to date checkout of the *argon2-cffi-bindings* repository:
If you're using tools that understand `.python-version` files like [*pyenv*](https://github.com/pyenv/pyenv) does, you can make it a link to the `.python-version-default` file.

---

Next, fork the repository on GitHub and get an up-to-date checkout:

```console
$ git clone [email protected]:hynek/argon2-cffi-bindings.git
$ git clone [email protected]:<your-username>/argon2-cffi-bindings.git
```

or if you want to use git via `https`:

```console
$ git clone https://github.com/hynek/argon2-cffi-bindings.git
$ git clone https://github.com/<your-username>/argon2-cffi-bindings.git
```

Change into the newly created directory and **activate your virtual environment**
Expand All @@ -65,8 +69,8 @@ $ git submodule update # update the vendored Argon2 C library to the version w
Now an editable version of *argon2-cffi-bindings* along with its test requirements can be installed as usual:

```console
$ python -m pip install --upgrade pip setuptools cffi # PLEASE don't skip this step
$ python -m pip install -e '.[dev]'
$ python -Im pip install --upgrade pip setuptools cffi # PLEASE don't skip this step
$ python -Im pip install -e '.[dev]'
```

At this point,
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,15 @@ on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

env:
FORCE_COLOR: "1" # Make tools pretty.
TOX_TESTENV_PASSENV: FORCE_COLOR
PIP_DISABLE_PIP_VERSION_CHECK: 1
PIP_NO_PYTHON_VERSION_WARNING: 1
SETUPTOOLS_SCM_PRETEND_VERSION: "1.0" # avoid warnings about shallow checkout
# N.B. default Python version for setup-python comes from the .python-version
# file at the root of the project.

permissions:
contents: read
permissions: {}

jobs:
tests:
Expand Down Expand Up @@ -63,11 +58,15 @@ jobs:

system-package:
runs-on: ubuntu-latest
name: Install and test with system package of Argon2.
name: Install and test with system package of Argon2

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
cache: pip
python-version-file: .python-version-default

- name: Install dependencies
run: |
sudo apt-get install libargon2-0 libargon2-0-dev
Expand All @@ -89,6 +88,7 @@ jobs:

- uses: actions/setup-python@v5
with:
cache: pip
python-version: "3.x" # use the one that baipp used

# Smoke-check the wheel against argon2-cffi.
Expand All @@ -109,6 +109,9 @@ jobs:
with:
submodules: recursive
- uses: actions/setup-python@v5
with:
cache: pip
python-version-file: .python-version-default
- run: python -Im pip install -e .[dev]
env:
ARCHFLAGS: -arch x86_64
Expand All @@ -128,15 +131,15 @@ jobs:
submodules: recursive
- uses: actions/setup-python@v5
with:
cache: pip
python-version: "3.x"

- run: python -Im pip install --upgrade wheel tox

- run: python -Im tox -e cog-check


# Ensure everything required is passing for branch protection.
required-checks-pass:
name: Ensure everything required is passing for branch protection
if: always()

needs:
Expand Down
File renamed without changes.

0 comments on commit 683aa81

Please sign in to comment.