Skip to content

Commit

Permalink
Merge pull request #13 from aptly-io/add_precommit_hook
Browse files Browse the repository at this point in the history
Add precommit hook
  • Loading branch information
aptly-io authored Mar 5, 2022
2 parents f0597c1 + de73e7e commit 1d8c4ed
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 17 deletions.
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- repo: https://github.com/psf/black
rev: "22.1.0"
hooks:
- id: black
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
args: [
"--rcfile=.pylintrc", # Link to your config file
]
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
"**/__pycache__": true,
"**/pwsync.egg-info": true,
}
}
}
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
prune tests*
prune tests*
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
_pwsync_ is a low level command line tool that synchronizes _password databases_.

`pwsync` grew from a personal need to simplify credential usage for online services
(e.g. for web shops, banks, cloud services, ...)
(e.g. for web shops, banks, cloud services, ...)
on different platforms (Ubuntu, iPad, Android mobile, ...).
Keepass feels outdated for such use-cases.
Keepass feels outdated for such use-cases.
Bitwarden (and alikes) simplify authentication thanks to its
[browser extension](https://bitwarden.com/help/article/getting-started-browserext/).
Due to the personal use case, `pwsync` only supports
Due to the personal use case, `pwsync` only supports
[_Keepass_](https://keepass.info/) database files
and [_Bitwarden_](https://bitwarden.com/) online database.
But anybody can add support for other cloud password services
But anybody can add support for other cloud password services
if their (public) REST API is known with a Pull Request.

These properties of the password database features are handled (the _lowest common denominator_):
Expand All @@ -38,7 +38,7 @@ These properties of the password database features are handled (the _lowest comm
(Keepass keeps this in its attributes property as _pws_sync_)

Support for fields, icons, expiration date, the automatic creation of organizations,
changes on a credential's collection set, Bitwarden's reprompt,
changes on a credential's collection set, Bitwarden's reprompt,
Bitwarden's multiple urls and matching patterns, privately hosted Bitwarden etc.
_is currently missing_!

Expand Down Expand Up @@ -68,8 +68,6 @@ pwsync -h
This tool and its installation description can be found
[here](https://bitwarden.com/help/article/cli/#download-and-install).

Take care! The Bitwarden-cli version 1.21.1 regressed since 1.19.1.
Find the issue here: https://github.com/bitwarden/cli/issues/490. So use version 1.19.1!
```bash
npm install -g @bitwarden/[email protected]
```
Expand Down Expand Up @@ -106,19 +104,22 @@ python -m pip install --upgrade -e .[dev]

# and/or with tools for building a distribution
python -m pip install --upgrade .[build]

# install a git pre-commit hooks according to .pre-commit-config.yaml
pre-commit install
```

### Development

```bash
# format the source code (configuration in pyproject.toml)
# format the source code (configuration in pyproject.toml) (done by pre-commit hook)
python -m black pwsync/*.py tests/*.py

# linting and source code analysis
# linting and source code analysis (ran in pre-commit hook)
python -m pylint pwsync tests || echo "FAILED"
python -m pylama pwsync/*.py

# tests with an xml coverage report for pwsync
# tests with an xml coverage report for pwsync
# the test_bwc requires an online account; provide the credentials in env. vars.
export TEST_BW_CLIENT_ID=
export TEST_BW_CLIENT_SECRET=
Expand All @@ -130,7 +131,7 @@ python -m pytest -s -vvv --cov=pwsync --cov-report=xml:cov.xml tests || echo "FA
python -m build

# upload on testpypi
twine check dist/* # basic check
twine check --strict dist/* # basic check

# do a minimal test of the package in a new venv
deactivate
Expand Down
9 changes: 5 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
setup(
name="pwsync",
license="GPL3",
license_files=('LICENSE',),
license_files=("LICENSE",),
author="Francis Meyvis",
author_email="[email protected]",
description="Synchronize password databases",
Expand All @@ -35,7 +35,7 @@
install_requires=[
"pykeepass==4.0.1",
"diffsync==1.4.2",
"prompt-toolkit==3.0.28"
"prompt-toolkit==3.0.28",
],
extras_require={
"dev": [
Expand All @@ -47,13 +47,14 @@
"pytz",
"types-python-dateutil",
"types-pytz",
"pre-commit",
],
"build": [
"setuptools>=45.0",
"wheel",
"build",
"twine"
]
"twine",
],
},
entry_points={
"console_scripts": ["pwsync=pwsync.main:main"],
Expand Down

0 comments on commit 1d8c4ed

Please sign in to comment.