-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from aptly-io/add_precommit_hook
Add precommit hook
- Loading branch information
Showing
5 changed files
with
39 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,4 @@ | |
"**/__pycache__": true, | ||
"**/pwsync.egg-info": true, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
prune tests* | ||
prune tests* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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_): | ||
|
@@ -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_! | ||
|
||
|
@@ -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] | ||
``` | ||
|
@@ -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= | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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", | ||
|
@@ -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": [ | ||
|
@@ -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"], | ||
|