[python] WIP switch to pdm

master
Nemo 9 months ago
parent dc6531ee98
commit 5d5e939a6b
  1. 49
      pyproject.toml
  2. 7
      src/pincode/__init__.py
  3. 2
      tests/test.py

@ -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" },
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries"
]
include = ["CHANGELOG.md", "README.md", "regex.txt"]
[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"
exclude = [
[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/"
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries"
]
[tool.poetry.dependencies]
python = "^3.5"
[tool.poetry.dev-dependencies]
]
[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"
requires = ["pdm-pep517"]
build-backend = "pdm.pep517.api"

@ -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):

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

Loading…
Cancel
Save