Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library upgrades #22

Closed
wants to merge 4 commits into from
Closed
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
22 changes: 12 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,32 @@ jobs:
max-parallel: 6
matrix:
os: [ 'ubuntu-latest', 'macos-latest' ,'windows-latest' ]
python: [ pypy-3.7, 3.7, 3.8, 3.9, '3.10', '3.11' ]
python: [ pypy-3.8, 3.8, 3.9, '3.10', '3.11', '3.12' ]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Install python dependencies
run: python -m pip install -U pip nox
- name: Install python pre-requisites
run: python -m pip install -U pip nox pipx
- name: Install poetry
run: pipx install "poetry<1.8.0"
- name: Lint
run: nox -s lint
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.11'
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.12'
- name: Scan packages for vulnerabilities
run: nox -s safety
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.11'
if: matrix.os == 'ubuntu-latest' && matrix.python == '3.12'
- name: CPython tests
run: nox -s tests-${{ matrix.python }}
if: matrix.python != 'pypy-3.7'
if: matrix.python != 'pypy-3.8'
- name: Pypy tests
run: nox -s tests-pypy3
if: matrix.python == 'pypy-3.7'
if: matrix.python == 'pypy-3.8'
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
if: matrix.python == '3.11'
if: matrix.python == '3.12'
with:
files: ./coverage.xml
14 changes: 8 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ jobs:
runs-on: 'ubuntu-latest'

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install python dependencies
run: python -m pip install -U pip nox
python-version: 3.8
- name: Install python pre-requisites
run: python -m pip install -U pip nox pipx
- name: Install poetry
run: pipx install "poetry<1.8.0"
- name: Build and deploy
run: nox -s deploy
env:
Expand Down
5 changes: 5 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ version: 2
mkdocs:
configuration: mkdocs.yml

build:
os: "ubuntu-22.04"
tools:
python: "3.8"

python:
install:
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion .safety-policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ security: # configuration for the `safety check` command
reason: |
The pytest team doesn't recognize this issue as critical, more information here:
https://github.com/pytest-dev/py/issues/287
expires: '2024-01-01'
expires: '2024-05-01'
continue-on-vulnerability-error: False # Suppress non-zero exit codes when vulnerabilities are found. Enable this in pipelines and CI/CD processes if you want to pass builds that have vulnerabilities. We recommend you set this to False.
alert: # configuration for the `safety alert` command
security:
Expand Down
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# Changelog

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]
## [0.6.0] - 2023-11-27

### Changed

- Upgraded `attrs` library to version **23.1.0**.

### Removed

- support for python3.6
- support for python 3.6 and python 3.7.

## [0.5.0] - 2021-12-16

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ If you want to propose a new feature:
## Code style

Here are some preferences I have when coding:
- Use single quotes wherever possible. Unfortunately `black` does not allow to enforce this rule.

- When writing a test function, the name should be as obvious as possible about what we want to test. I prefer the
formulation "test_should..<expectation>..when..<condition>". I'm not saying it is the best option all the time, but it
formulation `test_should..<expectation>..when..<condition>`. I'm not saying it is the best option all the time, but it
often tends to be more readable.

## Code contribution
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Kifurushi

[![Pypi version](https://img.shields.io/pypi/v/kifurushi.svg)](https://pypi.org/project/kifurushi/)
![](https://github.com/lewoudar/kifurushi/workflows/CI/badge.svg)
[![](https://github.com/lewoudar/kifurushi/workflows/CI/badge.svg)](https://github.com/lewoudar/kifurushi/actions)
[![Coverage Status](https://codecov.io/gh/lewoudar/kifurushi/branch/main/graphs/badge.svg?branch=main)](https://codecov.io/gh/lewoudar/kifurushi)
[![Documentation Status](https://readthedocs.org/projects/kifurushi/badge/?version=latest)](https://kifurushi.readthedocs.io/en/latest/?badge=latest)
[![Code Style](https://img.shields.io/badge/code%20style-black-black)](https://github.com/lewoudar/kifurushi)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/lewoudar/ws)
[![License Apache 2](https://img.shields.io/hexpm/l/plug.svg)](http://www.apache.org/licenses/LICENSE-2.0)
[![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://github.com/lewoudar/kifurushi)

A simple library to forge network packets.

Expand Down
8 changes: 4 additions & 4 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
attrs==21.2.0
mkdocs==1.3.0
mkdocs-material==8.3.3
mkautodoc==0.1.0
attrs==23.1.0
mkdocs==1.5.3
mkdocs-material==9.4.14
mkautodoc==0.2.0
18 changes: 7 additions & 11 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,38 @@

nox.options.reuse_existing_virtualenvs = True

PYTHON_VERSIONS = ['pypy3', '3.7', '3.8', '3.9', '3.10', '3.11']
PYTHON_VERSIONS = ['pypy3', '3.8', '3.9', '3.10', '3.11', '3.12']
CI_ENVIRONMENT = 'GITHUB_ACTIONS' in os.environ


@nox.session(python=PYTHON_VERSIONS[-1])
def lint(session):
"""Performs pep8 and security checks."""
source_code = 'kifurushi'
session.install('flake8==3.9.2', 'bandit==1.7.4', 'black==22.3.0')
session.run('flake8', source_code)
session.run('poetry', 'install', '--only', 'lint')
session.run('ruff', 'check', source_code)
session.run('ruff', 'format', '.')
session.run('bandit', '-r', source_code)
session.run('black', source_code, 'tests', '--check')


@nox.session(python=PYTHON_VERSIONS[-1])
def safety(session):
"""Checks vulnerabilities of the installed packages."""
session.install('poetry>=1.0.0,<1.3.0')
session.run('poetry', 'install')
session.run('poetry', 'install', '--only', 'audit')
session.run('safety', 'check')


@nox.session(python=PYTHON_VERSIONS)
def tests(session):
"""Runs the test suite."""
session.install('poetry>=1.0.0,<1.3.0')
session.run('poetry', 'install')
session.run('poetry', 'install', '--with', 'test')
session.run('pytest')


@nox.session(python=PYTHON_VERSIONS[-1])
def docs(session):
"""Builds the documentation."""
session.install('poetry>=1.0.0,<1.3.0')
session.run('poetry', 'install')
session.run('poetry', 'install', '--only', 'docs')
session.run('mkdocs', 'build', '--clean')


Expand All @@ -48,7 +45,6 @@ def deploy(session):
"""
Deploys on pypi.
"""
session.install('poetry>=1.0.0,<1.3.0')
if 'POETRY_PYPI_TOKEN_PYPI' not in os.environ:
session.error('you must specify your pypi token api to deploy your package')

Expand Down
Loading