Skip to content

Commit

Permalink
[AUTOPR] Updates and fix warnings (#48)
Browse files Browse the repository at this point in the history
* Fix formatting

* Update python setuptools

* Update golangci-lint

* Bump version

* Fix gcc warnings

---------

Co-authored-by: nicolaasuni-vonage <nicola.asuni@vonage.com>
  • Loading branch information
github-actions[bot] and nicolaasuni-vonage authored Aug 27, 2024
1 parent 9297f17 commit 82263c3
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade virtualenv
python -m pip install --upgrade setuptools virtualenv
- name: set RELEASE number
run: echo ${GITHUB_RUN_NUMBER} > RELEASE
- name: test
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
*Numerical Encoding for Short Codes or E.164 LVN*

Also includes:
* *prefixkey* To encode number prefixes or E.164 LVN as uint64.
* *countrykey* To encode ISO 3166 alpha-2 country code as uint16.

- *prefixkey* To encode number prefixes or E.164 LVN as uint64.
- *countrykey* To encode ISO 3166 alpha-2 country code as uint16.

[![check](https://github.com/Vonage/numkey/actions/workflows/check.yaml/badge.svg)](https://github.com/Vonage/numkey/actions/workflows/check.yaml)

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.6.14
1.6.15
2 changes: 1 addition & 1 deletion c/doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ PROJECT_NAME = "NumKey"
# This could be handy for archiving the generated documentation or
# if some version control system is used.

PROJECT_NUMBER = 1.6.14
PROJECT_NUMBER = 1.6.15

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer
Expand Down
5 changes: 5 additions & 0 deletions cgo/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ linters-settings:
allow:
- $gostd
- github.com/stretchr
gosec:
excludes:
# Flags for potentially-unsafe casting of ints, similar problem to globally-disabled G103
- G115

issues:
exclude-dirs:
Expand Down Expand Up @@ -70,3 +74,4 @@ linters:
- tagliatelle # Checks the struct tags. [fast: true, auto-fix: false]
- testpackage # linter that makes you use a separate _test package [fast: true, auto-fix: false]
- varnamelen # checks that the length of a variable's name matches its scope [fast: false, auto-fix: false]
- exportloopref # deprecated
2 changes: 1 addition & 1 deletion cgo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ GOFMT=$(shell which gofmt)
GOTEST=GOPATH=$(GOPATH) $(shell which gotest)
GODOC=GOPATH=$(GOPATH) $(shell which godoc)
GOLANGCILINT=$(BINUTIL)/golangci-lint
GOLANGCILINTVERSION=v1.60.1
GOLANGCILINTVERSION=v1.60.3

# Directory containing the source code
SRCDIR=./src
Expand Down
5 changes: 5 additions & 0 deletions go/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ linters-settings:
allow:
- $gostd
- github.com/stretchr
gosec:
excludes:
# Flags for potentially-unsafe casting of ints, similar problem to globally-disabled G103
- G115

issues:
exclude-dirs:
Expand Down Expand Up @@ -70,3 +74,4 @@ linters:
- tagliatelle # Checks the struct tags. [fast: true, auto-fix: false]
- testpackage # linter that makes you use a separate _test package [fast: true, auto-fix: false]
- varnamelen # checks that the length of a variable's name matches its scope [fast: false, auto-fix: false]
- exportloopref # deprecated
2 changes: 1 addition & 1 deletion go/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ GOFMT=$(shell which gofmt)
GOTEST=GOPATH=$(GOPATH) $(shell which gotest)
GODOC=GOPATH=$(GOPATH) $(shell which godoc)
GOLANGCILINT=$(BINUTIL)/golangci-lint
GOLANGCILINTVERSION=v1.60.1
GOLANGCILINTVERSION=v1.60.3

# Directory containing the source code
SRCDIR=./src
Expand Down
4 changes: 2 additions & 2 deletions python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ venv: clean version
source venv/bin/activate \
&& python --version \
&& pip install --upgrade pip \
&& pip install --pre wheel build black pytest pip-upgrade \
&& pip install -e .[test]
&& pip install --upgrade --pre wheel build black pytest setuptools \
&& pip install --use-pep517 --no-build-isolation -e .[test]

# Set the version from VERSION file
.PHONY: version
Expand Down
16 changes: 8 additions & 8 deletions python/numkey/pynumkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ static PyObject* py_decode_countrykey(PyObject *Py_UNUSED(ignored), PyObject *ar
static PyMethodDef PyNumKeyMethods[] =
{
// NUMKEY
{"numkey", (PyCFunction)py_numkey, METH_VARARGS|METH_KEYWORDS, PYNUMKEY_DOCSTRING},
{"decode_numkey", (PyCFunction)py_decode_numkey, METH_VARARGS|METH_KEYWORDS, PYDECODENUMKEY_DOCSTRING},
{"compare_numkey_country", (PyCFunction)py_compare_numkey_country, METH_VARARGS|METH_KEYWORDS, PYCOMPARENUMKEYCOUNTRY_DOCSTRING},
{"numkey_hex", (PyCFunction)py_numkey_hex, METH_VARARGS|METH_KEYWORDS, PYNUMKEYHEX_DOCSTRING},
{"parse_numkey_hex", (PyCFunction)py_parse_numkey_hex, METH_VARARGS|METH_KEYWORDS, PYPARSENUMKEYSTRING_DOCSTRING},
{"prefixkey", (PyCFunction)py_prefixkey, METH_VARARGS|METH_KEYWORDS, PYPREFIXKEY_DOCSTRING},
{"countrykey", (PyCFunction)py_countrykey, METH_VARARGS|METH_KEYWORDS, COUNTRYKEY_DOCSTRING},
{"decode_countrykey", (PyCFunction)py_decode_countrykey, METH_VARARGS|METH_KEYWORDS, DECODECOUNTRYKEY_DOCSTRING},
{"numkey", (PyCFunction)(void(*)(void))py_numkey, METH_VARARGS|METH_KEYWORDS, PYNUMKEY_DOCSTRING},
{"decode_numkey", (PyCFunction)(void(*)(void))py_decode_numkey, METH_VARARGS|METH_KEYWORDS, PYDECODENUMKEY_DOCSTRING},
{"compare_numkey_country", (PyCFunction)(void(*)(void))py_compare_numkey_country, METH_VARARGS|METH_KEYWORDS, PYCOMPARENUMKEYCOUNTRY_DOCSTRING},
{"numkey_hex", (PyCFunction)(void(*)(void))py_numkey_hex, METH_VARARGS|METH_KEYWORDS, PYNUMKEYHEX_DOCSTRING},
{"parse_numkey_hex", (PyCFunction)(void(*)(void))py_parse_numkey_hex, METH_VARARGS|METH_KEYWORDS, PYPARSENUMKEYSTRING_DOCSTRING},
{"prefixkey", (PyCFunction)(void(*)(void))py_prefixkey, METH_VARARGS|METH_KEYWORDS, PYPREFIXKEY_DOCSTRING},
{"countrykey", (PyCFunction)(void(*)(void))py_countrykey, METH_VARARGS|METH_KEYWORDS, COUNTRYKEY_DOCSTRING},
{"decode_countrykey", (PyCFunction)(void(*)(void))py_decode_countrykey, METH_VARARGS|METH_KEYWORDS, DECODECOUNTRYKEY_DOCSTRING},
{NULL, NULL, 0, NULL}
};

Expand Down
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def run(self):

setup(
name="numkey",
version="1.6.14.1",
version="1.6.15.1",
keywords=("numkey E.164 shortcode lvn did encoding"),
description="NumKey Bindings for Python",
long_description=read("../README.md"),
Expand Down

0 comments on commit 82263c3

Please sign in to comment.