pydantic / pydantic-extra-types

Extra Pydantic types.
MIT License
181 stars 48 forks source link

add missing countries #32

Closed EssaAlshammri closed 1 year ago

EssaAlshammri commented 1 year ago

as disscused in #11

@yezz123

yezz123 commented 1 year ago

Great! Thank you @EssaAlshammri

Can you run pip-tools to refresh the dependencies to fix the CI/CD

EssaAlshammri commented 1 year ago

I'm sorry I didn't grasp that!

@yezz123

yezz123 commented 1 year ago

Yes you can install pip-tools and run make refresh-lockfiles then also check using pre-commit if there is any linting issues

EssaAlshammri commented 1 year ago

Oh yeah I did that and it complained about double quotes. but there are a handfull countries that include single ones.

should I escape them ?

EssaAlshammri commented 1 year ago

When I escape single quotes it says: Q003 [*] Change outer quotes to avoid escaping inner quotes

and when I enclose them with double ones it says: Q000 [*] Double quotes found but single quotes preferred

currently it looks like this

CountryInfo(
    'DZ',
    'DZA',
    '012',
    'Algeria',
    "People's Democratic Republic of Algeria",
),
yezz123 commented 1 year ago

@EssaAlshammri we can change the configuration regarding ruff in pyproject.toml

EssaAlshammri commented 1 year ago

by using

avoid-escape = false

or

inline-quotes = 'single' => inline-quotes = 'double' this will make lint break on other files

?

EssaAlshammri commented 1 year ago

or this way

'pydantic_extra_types/types/country.py' = ['Q000']

yezz123 commented 1 year ago

or this way

'pydantic_extra_types/types/country.py' = ['Q000']

👍🏻

EssaAlshammri commented 1 year ago

should I push the changes made by make refresh-lockfiles ?

yezz123 commented 1 year ago

should I push the changes made by make refresh-lockfiles ?

yes

EssaAlshammri commented 1 year ago

error: Unused "type: ignore" comment from mypy

yezz123 commented 1 year ago

error: Unused "type: ignore" comment from mypy

I will fix it later, its regarding some changes in the logic 🙏🏻

Thank you @EssaAlshammri

EssaAlshammri commented 1 year ago

thank you :)

test aren't passing too

EssaAlshammri commented 1 year ago

side note

CountryInfo(
            "XK",
            "UNK",
            "",
            "Kosovo",
            "Republic of Kosovo",
        ),

this country doesn't have a numeric code and it's not listed in https://www.iso.org/iso-3166-country-codes.html

I guess something has to be done either delete it or write something in that field to indecate it doesn't have one.