dimanche 12 juin 2016

How to structure python project with dot "." or underscore "-" in project/package name?


PEP 423 states that project names and package names should be the same and later gives an example where the project/package name contains a dot:

Yes:
Package name: "kheops.pyramid", i.e. import kheops.pyramid
Project name: "kheops.pyramid", i.e. pip install kheops.pyramid

What would the directory structure be for kheops.pyramid and how would setup.py be written (specifically the name and packages values) for that directory structure?

I've also seen that PEP 503 states that names should be normalized by replacing _, -, and . with -. Does this mean that kheops-pyramid should be used rather than kheops.pyramid? If so, wouldn't I need a package whose directory name is kheops-pyramid and wouldn't the - cause issues (eg. syntax error) when trying to import kheops-pyramid?


Aucun commentaire:

Enregistrer un commentaire