pydantic / pydantic-extra-types

Extra Pydantic types.
MIT License
193 stars 51 forks source link

Problem with importing mac_address #80

Closed rrzaripov closed 1 year ago

rrzaripov commented 1 year ago

Hi, I'm get ModuleNotFoundError while import of mac_adderess:

(test) renat@book:/tmp/test $ python --version
Python 3.11.2
(test) renat@book:/tmp/test $ pip list
Package              Version
-------------------- -------
annotated-types      0.5.0
phonenumbers         8.13.15
pip                  23.0.1
pydantic             2.0.2
pydantic_core        2.1.2
pydantic-extra-types 2.0.0
setuptools           66.1.1
typing_extensions    4.7.1
(test) renat@book:/tmp/test $ python
Python 3.11.2 (main, May 30 2023, 17:45:26) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pydantic_extra_types.mac_address import MacAddress
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'pydantic_extra_types.mac_address'

Somebody can confirm or problem only on my side? Thanks in advance!

Selected Assignee: @hramezani

yezz123 commented 1 year ago

Hello @rrzaripov i guess this one will work on fixing this https://github.com/pydantic/pydantic-extra-types/pull/79

rrzaripov commented 1 year ago

Thanks @yezz123 in this case I will put my eyes on this pull.

yezz123 commented 1 year ago

Thanks @yezz123 in this case I will put my eyes on this pull.

Its Merged 👍🏻

yezz123 commented 1 year ago

I guess its working fine now

from pydantic import BaseModel
from pydantic_extra_types.mac_address import MacAddress

class Network(BaseModel):
     mac_address: MacAddress

network = Network(mac_address='00:00:5e:00:53:01')

print(network.mac_address)

using:

pydantic-extra-types@git+https://github.com/pydantic/pydantic-extra-types.git@main