Skip to content
Open
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
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
Changelog
=========

0.2.0
-----

* Added Maturin backend


0.1.5
-----

* Added python 3.8 and 3.9 support


Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fast_luhn"
version = "0.1.5"
version = "0.2.0"
authors = ["Matt Stroganov <strmatvey@gmail.com>"]
edition = "2018"

Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Rust realization for speed-up python code. Thread-safe. See benchmark_ for detai
.. _Luhn-algorithm: https://en.wikipedia.org/wiki/Luhn_algorithm

:Author: Matt Stroganov
:Version: 0.1.5
:Version: 0.2.0


Installation
Expand Down Expand Up @@ -73,7 +73,7 @@ Install from sources:
$ git clone https://github.com/cybermatt/fast-luhn
$ cd fast-luhn
$ pip install -r requirements-dev.txt
$ python ./setup.py develop
$ maturin develop


Benchmark
Expand Down Expand Up @@ -108,7 +108,7 @@ Tests

::

$ pytest -v tests.py
$ pytest -v


License
Expand Down
2 changes: 1 addition & 1 deletion fast_luhn/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from .fast_luhn import validate, digit, complete, generate


__version__ = '0.1.5'
__version__ = '0.2.0'
__author__ = 'Matt Stroganov'


Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[build-system]
requires = ["setuptools", "wheel", "setuptools-rust"]
requires = ["setuptools", "wheel", "setuptools-rust", "maturin>=1.0,<2.0"]
build-backend = "maturin"
9 changes: 5 additions & 4 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pytest>=3.5.0
wheel==0.38.1
auditwheel==2.0.0
setuptools-rust>=0.10.2
pytest>=8.0.1
wheel==0.42.0
auditwheel>=6.0.0
setuptools-rust>=1.8.1
maturin==1.4.0
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
universal = 1

[metadata]
license_file = LICENSE.txt
# license_file = LICENSE.txt
14 changes: 6 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import setup

import fast_luhn as module
# import fast_luhn as module


try:
Expand All @@ -25,8 +25,6 @@ def read(fname):

setup(
name='fast-luhn',
version=module.__version__,
author=module.__author__,
description='Fast Luhn algorithm',
long_description=read('README.rst'),
keywords='luhn validation',
Expand Down Expand Up @@ -62,10 +60,10 @@ def read(fname):
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
setup_requires=[
'setuptools',
'setuptools_rust',
'wheel==0.38.1',
],
# setup_requires=[
# 'setuptools',
# 'setuptools_rust',
# 'wheel==0.42.0',
# ],
zip_safe=False,
)
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(specialization)]
extern crate pyo3;
extern crate rand;

Expand Down Expand Up @@ -76,7 +75,7 @@ mod luhn {
}

pub fn digit(string: &str) -> u32{
let mut valid_string = string.clone().to_string();
let mut valid_string = string.to_string();
valid_string.push_str("0");
let chsum = checksum(&valid_string);
let x = 10 - (chsum % 10);
Expand Down
File renamed without changes.