[python] WIP switch to pdm
This commit is contained in:
parent
dc6531ee98
commit
5d5e939a6b
|
@ -1,44 +1,43 @@
|
||||||
[tool.poetry]
|
[project]
|
||||||
name = "pincode"
|
name = "pincode"
|
||||||
version = "1.0.4"
|
version = "1.0.4"
|
||||||
description = "A simple offline pincode validator for India"
|
description = "A simple offline pincode validator for India"
|
||||||
authors = ["Nemo <python@captnemo.in>"]
|
authors = [
|
||||||
license = "MIT"
|
{name = "Nemo", email = "python@captnemo.in"},
|
||||||
|
]
|
||||||
|
dependencies = ["requests"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
homepage = "https://github.com/captn3m0/india-pincode-regex"
|
requires-python = ">=3.7"
|
||||||
repository = "https://github.com/captn3m0/india-pincode-regex"
|
license = {text = "MIT"}
|
||||||
documentation = "https://github.com/captn3m0/india-pincode-regex/wiki"
|
|
||||||
keywords = ["pincode", "regex", "offline", "pin", "validator"]
|
keywords = ["pincode", "regex", "offline", "pin", "validator"]
|
||||||
|
|
||||||
packages = [
|
|
||||||
{ include = "pincode", from = "src" },
|
|
||||||
]
|
|
||||||
|
|
||||||
include = ["CHANGELOG.md", "README.md", "regex.txt"]
|
|
||||||
|
|
||||||
exclude = [
|
|
||||||
"src/*.js",
|
|
||||||
"src/*.php",
|
|
||||||
"tests/*.php",
|
|
||||||
"tests/*.js",
|
|
||||||
"vendor/",
|
|
||||||
"composer.",
|
|
||||||
"package.json",
|
|
||||||
"package-lock.json",
|
|
||||||
"node_modules/"
|
|
||||||
]
|
|
||||||
|
|
||||||
classifiers = [
|
classifiers = [
|
||||||
"Development Status :: 4 - Beta",
|
"Development Status :: 4 - Beta",
|
||||||
"Intended Audience :: Developers",
|
"Intended Audience :: Developers",
|
||||||
"Topic :: Software Development :: Libraries"
|
"Topic :: Software Development :: Libraries"
|
||||||
]
|
]
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[project.urls]
|
||||||
python = "^3.5"
|
homepage = "https://github.com/captn3m0/india-pincode-regex"
|
||||||
|
Repository = "https://github.com/captn3m0/india-pincode-regex"
|
||||||
|
Documentation = "https://github.com/captn3m0/india-pincode-regex/wiki"
|
||||||
|
|
||||||
[tool.poetry.dev-dependencies]
|
[tool.pdm]
|
||||||
|
includes = ["CHANGELOG.md", "README.md", "regex.txt", "src/pincode"]
|
||||||
|
excludes = [
|
||||||
|
"src/*.js",
|
||||||
|
"src/*.php",
|
||||||
|
"tests/*.php",
|
||||||
|
"tests/*.js",
|
||||||
|
"tests/*.rb",
|
||||||
|
"tests/*.html",
|
||||||
|
"tests/jasmine*",
|
||||||
|
"vendor/",
|
||||||
|
"composer.",
|
||||||
|
"package.json",
|
||||||
|
"package-lock.json",
|
||||||
|
"node_modules/"
|
||||||
|
]
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry>=0.12"]
|
requires = ["pdm-pep517"]
|
||||||
build-backend = "poetry.masonry.api"
|
build-backend = "pdm.pep517.api"
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
def get_project_root() -> Path:
|
||||||
|
return Path(__file__).parent.parent.parent
|
||||||
|
|
||||||
regex = list()
|
regex = list()
|
||||||
dir_path = os.path.dirname(os.path.realpath(__file__))
|
dir_path = os.path.dirname(os.path.realpath(__file__))
|
||||||
f = open(dir_path + '/../../regex.txt')
|
f = open(get_project_root() / 'regex.txt')
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if (len(line) > 10):
|
if (len(line) > 10):
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
from pincode import *
|
from pincode import Pincode
|
||||||
from nose.tools import assert_equals
|
from nose.tools import assert_equals
|
||||||
|
|
||||||
def test_valid_pincodes():
|
def test_valid_pincodes():
|
||||||
|
|
Loading…
Reference in New Issue