Skip to content

Commit

Permalink
Improve layout
Browse files Browse the repository at this point in the history
  • Loading branch information
holgern committed Mar 1, 2024
1 parent 462a8ba commit 02f82f4
Show file tree
Hide file tree
Showing 26 changed files with 490 additions and 388 deletions.
5 changes: 3 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ignore =
# indentation is not a multiple of four,
E111,E114,
# visually indented line with same indent as next logical line,
E129
E129,
W503

max-line-length=80
max-line-length=100
3 changes: 3 additions & 0 deletions .github/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
norecursedirs = .git .* *.egg* old dist build
addopts = -rw
15 changes: 15 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: pre-commit

on:
pull_request:
push:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.9"
- uses: pre-commit/[email protected]
20 changes: 20 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Run tests
on: [push]
jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-2019, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@master
- name: Setup Python
uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}
- name: Install packages
run: |
pip install pytest
pip install -e .
pytest
3 changes: 1 addition & 2 deletions .github/workflows/wheels_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
with:
name: artifact-${{ matrix.python }}
path: wheelhouse/*.whl

upload_pypi:
name: Upload to PyPI (prod)
needs: [build_aarch64_wheels]
Expand All @@ -52,4 +52,3 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

1 change: 0 additions & 1 deletion .github/workflows/wheels_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,3 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

2 changes: 1 addition & 1 deletion .github/workflows/wheels_sdist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
path: dist/*.tar.gz
- name: Check metadata
run: twine check dist/*

upload_pypi:
name: Upload to PyPI (prod)
needs: [make_sdist]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheels_win_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ env:
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: "pytest --pyargs scrypt"
jobs:

build_wheels_for_win:
name: Build wheels on Win64
runs-on: windows-latest
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,4 @@ ENV/

# wing
*.wpr
*.wpu
*.wpu
61 changes: 61 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@

default_language_version:
python: python3
repos:
- repo: https://github.com/psf/black
rev: 24.2.0
hooks:
- id: black
exclude: ^(scrypt-1.2.1/)
args: [--skip-string-normalization]
- repo: https://github.com/myint/autoflake
rev: v2.3.0
hooks:
- id: autoflake
exclude: ^(scrypt-1.2.1/)
args:
- --in-place
- --ignore-init-module-imports
- --remove-all-unused-imports
- --remove-duplicate-keys
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-toml
- id: check-yaml
- id: end-of-file-fixer
exclude: ^(scrypt-1.2.1/)
- id: trailing-whitespace
exclude: ^(scrypt-1.2.1/)
- repo: https://github.com/PyCQA/flake8
rev: "7.0.0"
hooks:
- id: flake8
name: flake8 except __init__.py
exclude: (^(scrypt-1.2.1/)|/__init__\.py$)
additional_dependencies: ["flake8-bugbear==23.1.20"]
args: [--config, .flake8]
- id: flake8
exclude: ^(scrypt-1.2.1/)
name: flake8 only __init__.py
args: [--config, .flake8, "--extend-ignore=F401"] # ignore unused imports in __init__.py
files: /__init__\.py$
- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]
name: isort except __init__.py
exclude: (^(scrypt-1.2.1/)|/__init__\.py$)
- repo: https://github.com/myint/docformatter
rev: v1.7.5
hooks:
- id: docformatter
exclude: ^(scrypt-1.2.1/)
args: ["--in-place", "--wrap-summaries=88"]
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.1
hooks:
- id: pyupgrade
exclude: ^(scrypt-1.2.1/)
args: ["--py37-plus"]
22 changes: 11 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ function.
.. image:: https://img.shields.io/pypi/v/scrypt.svg
:target: https://pypi.python.org/pypi/scrypt/
:alt: Latest Version
.. image:: https://anaconda.org/conda-forge/scrypt/badges/version.svg

.. image:: https://anaconda.org/conda-forge/scrypt/badges/version.svg
:target: https://anaconda.org/conda-forge/scrypt
.. image:: https://anaconda.org/conda-forge/scrypt/badges/downloads.svg

.. image:: https://anaconda.org/conda-forge/scrypt/badges/downloads.svg
:target: https://anaconda.org/conda-forge/scrypt


.. image:: https://ci.appveyor.com/api/projects/status/h644bjbdawke9vf2?svg=true
.. image:: https://ci.appveyor.com/api/projects/status/h644bjbdawke9vf2?svg=true
:target: https://ci.appveyor.com/project/holger80/py-scrypt

.. image:: https://www.travis-ci.com/holgern/py-scrypt.svg?branch=master
Expand All @@ -35,7 +35,7 @@ Installation
============

For Debian and Ubuntu, please ensure that the following packages are installed:

.. code:: bash
$ sudo apt-get install build-essential libssl-dev python-dev
Expand All @@ -54,8 +54,8 @@ For OSX, please do the following::

For OSX, you can also use the precompiled wheels. They are installed by::

$ pip install scrypt
$ pip install scrypt

For Windows, please use the precompiled wheels. They are installed by::

$ pip install scrypt
Expand Down Expand Up @@ -112,8 +112,8 @@ Changelog
0.8.17
------

* add_dll_directory for python 3.8 on windows, as importlib.util.find_spec does not search all paths anymore
* add_dll_directory for python 3.8 on windows, as importlib.util.find_spec does not search all paths anymore

0.8.16
------

Expand Down Expand Up @@ -175,7 +175,7 @@ Changelog
-----

* MANIFEST.in fixed
* scrypt.py moved into own scrypt directory with __init__.py
* scrypt.py moved into own scrypt directory with __init__.py
* openssl library path for osx wheel repaired

0.8.4
Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
tox
nose
pytest
pytest
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ select = "*-musllinux*"
before-all = "apk add openssl-dev"

[tool.cibuildwheel.macos]
before-all = "brew install [email protected]"
before-all = "brew install [email protected]"
2 changes: 1 addition & 1 deletion scrypt-windows-stubs/include/getopt.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* Copyright (c)2002-2003 Mark K. Kim
* All rights reserved.
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
Expand Down
18 changes: 9 additions & 9 deletions scrypt-windows-stubs/include/inttypes.h
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
// ISO C9x compliant inttypes.h for Microsoft Visual Studio
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
//
// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
//
// Copyright (c) 2006 Alexander Chemeris
//
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
//
// 3. The name of the author may be used to endorse or promote products
// derived from this software without specific prior written permission.
//
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//
///////////////////////////////////////////////////////////////////////////////

#ifndef _MSC_VER // [
Expand Down
6 changes: 3 additions & 3 deletions scrypt-windows-stubs/include/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#ifndef _UNISTD_H
#define _UNISTD_H 1

/* This file intended to serve as a drop-in replacement for
/* This file intended to serve as a drop-in replacement for
* unistd.h on Windows
* Please add functionality as neeeded
* Please add functionality as neeeded
*/

#include <stdlib.h>
Expand Down Expand Up @@ -37,7 +37,7 @@
#define STDERR_FILENO 2
/* should be in some equivalent to <sys/types.h> */
typedef __int8 int8_t;
typedef __int16 int16_t;
typedef __int16 int16_t;
typedef __int32 int32_t;
typedef __int64 int64_t;
typedef unsigned __int8 uint8_t;
Expand Down
4 changes: 3 additions & 1 deletion scrypt/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from .scrypt import *
from .scrypt import encrypt, decrypt, hash, error

__all__ = ['error', 'encrypt', 'decrypt', 'hash']
Loading

0 comments on commit 02f82f4

Please sign in to comment.