[python] WIP switch to pdm

This commit is contained in:
Nemo 2021-12-19 19:19:10 +05:30
parent dc6531ee98
commit 5d5e939a6b
3 changed files with 36 additions and 32 deletions

View File

@ -1,44 +1,43 @@
[tool.poetry]
[project]
name = "pincode"
version = "1.0.4"
description = "A simple offline pincode validator for India"
authors = ["Nemo <python@captnemo.in>"]
license = "MIT"
authors = [
{name = "Nemo", email = "python@captnemo.in"},
]
dependencies = ["requests"]
readme = "README.md"
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"
requires-python = ">=3.7"
license = {text = "MIT"}
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 = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries"
]
[tool.poetry.dependencies]
python = "^3.5"
[project.urls]
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]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
requires = ["pdm-pep517"]
build-backend = "pdm.pep517.api"

View File

@ -1,9 +1,14 @@
import os
import re
from pathlib import Path
def get_project_root() -> Path:
return Path(__file__).parent.parent.parent
regex = list()
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()
for line in lines:
if (len(line) > 10):

View File

@ -1,4 +1,4 @@
from pincode import *
from pincode import Pincode
from nose.tools import assert_equals
def test_valid_pincodes():