Skip to content

Commit

Permalink
Merge pull request #59 from dannyhajj/test-suite
Browse files Browse the repository at this point in the history
Test suite
  • Loading branch information
frozzare authored Nov 27, 2023
2 parents ded0895 + 5fe784d commit d21ad35
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
fail-fast: false
max-parallel: 1
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -28,6 +28,6 @@ jobs:
pip install -U setuptools
- name: Run tests
run: |
python setup.py clean --all
python setup.py install
python -W all setup.py test
pip install .[dev]
pytest
python -m build
3 changes: 2 additions & 1 deletion personnummer/tests/test_personnummer.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from datetime import datetime
from unittest import TestCase
from unittest import mock

from personnummer import personnummer
import urllib.request
import json
import mock


def get_test_data():
Expand Down
41 changes: 41 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[build-system]
requires = ["setuptools>=61.2", "wheel"]
build-backend = "setuptools.build_meta"

[project]
version = "3.1.0"
name = "personnummer"
description = "Validate Swedish personal identity numbers"
license = { file = "./LICENSE" }
readme = "README.md"
authors = [
{ name = "Personnummer and Contributors", email = "[email protected]" },
]

[project.urls]
homepage = "https://personnummer.dev"
repository = "https://github.com/personnummer/python"

[project.entry-points."console_scripts"]
personnummer = "personnummer.main:main"

[project.optional-dependencies]
dev = [
"pytest",
"build",
]

[options]
packages = ["personnummer"]

[tool.setuptools]
include-package-data = false

[tool.setuptools.packages.find]
exclude = ["personnummer/tests*"]

[tool.pytest.ini_options]
testpaths = [
"personnummer/tests",
]
addopts = "-ra -v"
19 changes: 3 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
from setuptools import setup
import setuptools

setup(
name='personnummer',
version='3.0.6',
description='Validate Swedish personal identity numbers',
url='http://github.com/personnummer/python',
author='Personnummer and Contributors',
author_email='[email protected]',
license='MIT',
packages=['personnummer'],
test_suite='nose.collector',
tests_require=['nose', 'mock'],
entry_points={
'console_scripts': ['personnummer = personnummer.main:main']
},
)
if __name__ == "__main__":
setuptools.setup()

0 comments on commit d21ad35

Please sign in to comment.