Skip to content

Commit

Permalink
Merge branch 'main' into afh-kind-option
Browse files Browse the repository at this point in the history
  • Loading branch information
lucc authored Dec 18, 2024
2 parents 36403f2 + 82e576f commit 44f8d11
Show file tree
Hide file tree
Showing 49 changed files with 1,310 additions and 826 deletions.
122 changes: 25 additions & 97 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: ci

on: [push]
on: [push, pull_request]

jobs:

Expand All @@ -9,11 +9,11 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -22,118 +22,46 @@ jobs:
python -m pip install flake8
python -m pip install .
- name: Run tests
run: python setup.py test
run: python3 -m unittest

type-checker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
python -m pip install mypy
python -m pip install types-atomicwrites
# vobject does fancy dynamic stuff that is hard to type-check
python -m pip install types-atomicwrites # types-vobject
- name: Run the type checker
run: mypy --ignore-missing-imports khard
run: mypy

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .[doc]
- name: Build the documentation
run: |
python setup.py build
make -C doc html man
run: make -C doc html man

#
#
##-------------------------------------- python package
#
## This workflow will install Python dependencies, run tests and lint with a variety of Python versions
## For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# Python-package-build:
#
# runs-on: ubuntu-latest
# strategy:
# fail-fast: false
# matrix:
# python-version: ["3.8", "3.9", "3.10"]
#
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# python -m pip install flake8
# python -m pip install .
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings.
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - name: Run tests
# run: python setup.py test
#
##-------------------------------------- python app
#
## This workflow will install Python dependencies, run tests and lint with a single version of Python
## For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
# Python-application-build:
#
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python 3.10
# uses: actions/setup-python@v2
# with:
# python-version: "3.10"
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install flake8 pytest
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
# - name: Test with pytest
# run: |
# pytest
#
##-------------------------------------- python lint
# Pylint-build:
# runs-on: ubuntu-latest
# strategy:
# matrix:
# python-version: ["3.8", "3.9", "3.10"]
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v2
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install pylint
# - name: Analysing the code with pylint
# run: |
# pylint $(git ls-files '*.py')
nix:
runs-on: ubuntu-latest
steps:
- name: Install Nix
uses: cachix/install-nix-action@v20
- uses: actions/checkout@v3
- name: Build the nix derivation (also runs the tests)
run: nix build --print-build-logs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ doc/source/examples/template.yaml
.pytest_cache
__pycache__
khard.egg-info
result
15 changes: 11 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/source/conf.py

python:
install:
# Run setup.py first to generate the version.py file. For some reason it
# is not generated with `pip install .[doc]`
- method: setuptools
path: .
- method: pip
path: .
extra_requirements:
Expand Down
36 changes: 0 additions & 36 deletions .travis.yml

This file was deleted.

45 changes: 40 additions & 5 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
Change Log
==========

v0.19.1: 2023-11-26

- Fix documentation builds on https://khard.readthedocs.io/


v0.19.0: 2023-11-23

- Remove support for python 3.7
- Run tests on python 3.11 and 3.12 in CI
- Fix yaml conversion of multiple addresses with same label (#323, #324)
- Improve error message for address book paths (884f1d9)
- Add pyproject.toml file and deprecate setup.py
- Remove deprecated options from --help and zsh completion
- Internal changes:
- Add a general ask() function (#320, #326)
- Use an exception to cancle user interactions (#325)
- More and stricter type hints
- Promote AddressBookCollection to a Sequence


v0.18.0: 2022-12-10
- Move project home on GitHub from @scheibler to @lucc
- Catch exceptions when loading the config (#294)
- Split $EDITOR env variable on spaces (#314)
- Add special phone number field query
- Add-email command improved: Attach email address to an existing contact
- Add-email command: new option --skip-already-added
- Add partial support for KIND: search query, display in details and listing (#309)
- Add show_kinds config option (#309)
- Add nix flake
- Remove support for python 3.6
- Remove deprecated subcommands "export" and "source"
- Switch from Travis to GitHub CI


v0.17.0: 2020-08-13
- Do not modify (clean up) search query to find more matches (4583efd)
- Remove special search handling for phone numbers (a570a85)
Expand Down Expand Up @@ -38,7 +73,7 @@ v0.15.0: 2019-10-24
- handle ABLABELs on most fields
- add formatted name to the yaml template
- show formatted name in contact details
- make it possible to sort by and display formatted name in linstings
- make it possible to sort by and display formatted name in listings
- remove the khard-runner.py helper script
- validate the config file upon loading it
- internal code refactoring
Expand All @@ -49,7 +84,7 @@ v0.14.0: 2019-06-21
- Allow vcard selections to be aborted explicitly
- Unify edit and source subcommands
- Merge export and show subcommands
- Turn template export into a seperate command
- Turn template export into a separate command
- Require python >= 3.5
- Add html documentation (generated with sphinx)
- Add man page (generated with sphinx)
Expand Down Expand Up @@ -123,7 +158,7 @@ v0.11.0: 2016-07-17
--skip-unparsable to skip unparsable vcard files (#75)
--strict-search to narrow the contact search to the name field
- Added some aliases for program actions (#65)
- Removed davcontroler module due to the python3 incompatibility (script moved into the misc folder)
- Removed davcontroller module due to the python3 incompatibility (script moved into the misc folder)
- Updated zsh completion function and khards example config file


Expand Down Expand Up @@ -168,11 +203,11 @@ v0.7.3: 2016-01-08


v0.7.2: 2016-01-03
- Use of module atomicwrites to securely write vcards to disk
- Use of module atomicwrites to securely write vCards to disk


v0.7.1: 2016-01-01
- Added support for multiple instances of one vcard attribute
- Added support for multiple instances of one vCard attribute


v0.7.0: 2015-12-18
Expand Down
36 changes: 18 additions & 18 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,14 @@ easier for maintainers to help:
- report the version(s) that are affected
- state the python version you are using
- if there are stack tracebacks post them with your bug report
- supply a minimal configuration (config file and vcards) to reproduce the
- supply a minimal configuration (config file and vCards) to reproduce the
error

Feature requests
----------------

Please stick to the following standards when you open pull requests:

- Khard's development tries to follow `Vincent's branching model`_ so normal
pull requests should be made against the `develop`_ branch. Only important
bug fixes that affect the current release should be opened against `master`_.
- Write "good" commit messages, especially a proper subject line. This is also
explained in `the Git book`_.
- Format your python code according to `PEP 8`_. Tools like `pylint`_ also
Expand All @@ -47,28 +44,31 @@ Please stick to the following standards when you open pull requests:
Development
-----------

In order to start coding you need to fetch the develop branch:
It is recommended to create a `virtualenv`_ to isolate the development
environment for Khard from your system's Python installation:

.. code-block:: shell
python3 -m venv khard-dev-venv
. khard-dev-venv/bin/activate
The you can install the dependencies with ``pip``:

.. code-block:: shell
git clone https://github.com/scheibler/khard
cd khard
python setup.py build # to generate the version.py file
python -m khard --help
# or
pip3 install --editable .
khard --help
Alternatively you can use the ``setup.py`` script directly. If you want to
isolate khard from your system Python environment you can use a `virtualenv`_
to do so.
If you have the `Nix`_ package manager installed you can use the ``flake.nix``
that is provided with Khard. It provides an isolated Python version with all
dependencies with ``nix develop``.

.. _bug reports: https://github.com/scheibler/khard/issues
.. _bug reports: https://github.com/lucc/khard/issues
.. _the Git book: https://www.git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#_commit_guidelines
.. _develop: https://github.com/scheibler/khard/tree/develop
.. _feature requests: https://github.com/scheibler/khard/pulls
.. _Github: https://github.com/scheibler/khard
.. _master: https://github.com/scheibler/khard/tree/master
.. _feature requests: https://github.com/lucc/khard/pulls
.. _Github: https://github.com/lucc/khard
.. _master: https://github.com/lucc/khard/tree/master
.. _Nix: https://nixos.org
.. _PEP 8: https://www.python.org/dev/peps/pep-0008/
.. _pylint: https://pylint.readthedocs.io/en/latest/
.. |travis| image:: https://github.com/lucc/khard/actions/workflows/ci.yml/badge.svg
Expand Down
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

Loading

0 comments on commit 44f8d11

Please sign in to comment.