From 2e0fcebb8ec19e1934107f9e71ded2856ad71b91 Mon Sep 17 00:00:00 2001 From: Oscar Benjamin Date: Sun, 4 Apr 2021 23:06:07 +0100 Subject: [PATCH] refactor: make flint a submodule of a flint package --- setup.py | 4 +++- src/flint/__init__.py | 1 + src/{flint.pxd => flint/_flint.pxd} | 0 src/{ => flint}/acb.pyx | 0 src/{ => flint}/acb_mat.pyx | 0 src/{ => flint}/acb_poly.pyx | 0 src/{ => flint}/acb_series.pyx | 0 src/{ => flint}/arb.pyx | 0 src/{ => flint}/arb_mat.pyx | 0 src/{ => flint}/arb_poly.pyx | 0 src/{ => flint}/arb_series.pyx | 0 src/{ => flint}/arf.pyx | 0 src/{ => flint}/dirichlet.pyx | 0 src/{ => flint}/fmpq.pyx | 0 src/{ => flint}/fmpq_mat.pyx | 0 src/{ => flint}/fmpq_poly.pyx | 0 src/{ => flint}/fmpq_series.pyx | 0 src/{ => flint}/fmpz.pyx | 0 src/{ => flint}/fmpz_mat.pyx | 0 src/{ => flint}/fmpz_mpoly.pyx | 0 src/{ => flint}/fmpz_poly.pyx | 0 src/{ => flint}/fmpz_series.pyx | 0 src/{ => flint}/functions.pyx | 0 src/{ => flint}/nmod.pyx | 0 src/{ => flint}/nmod_mat.pyx | 0 src/{ => flint}/nmod_poly.pyx | 0 src/{ => flint}/nmod_series.pyx | 0 src/{ => flint}/pyflint.pxd | 2 +- src/{ => flint}/pyflint.pyx | 0 29 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 src/flint/__init__.py rename src/{flint.pxd => flint/_flint.pxd} (100%) rename src/{ => flint}/acb.pyx (100%) rename src/{ => flint}/acb_mat.pyx (100%) rename src/{ => flint}/acb_poly.pyx (100%) rename src/{ => flint}/acb_series.pyx (100%) rename src/{ => flint}/arb.pyx (100%) rename src/{ => flint}/arb_mat.pyx (100%) rename src/{ => flint}/arb_poly.pyx (100%) rename src/{ => flint}/arb_series.pyx (100%) rename src/{ => flint}/arf.pyx (100%) rename src/{ => flint}/dirichlet.pyx (100%) rename src/{ => flint}/fmpq.pyx (100%) rename src/{ => flint}/fmpq_mat.pyx (100%) rename src/{ => flint}/fmpq_poly.pyx (100%) rename src/{ => flint}/fmpq_series.pyx (100%) rename src/{ => flint}/fmpz.pyx (100%) rename src/{ => flint}/fmpz_mat.pyx (100%) rename src/{ => flint}/fmpz_mpoly.pyx (100%) rename src/{ => flint}/fmpz_poly.pyx (100%) rename src/{ => flint}/fmpz_series.pyx (100%) rename src/{ => flint}/functions.pyx (100%) rename src/{ => flint}/nmod.pyx (100%) rename src/{ => flint}/nmod_mat.pyx (100%) rename src/{ => flint}/nmod_poly.pyx (100%) rename src/{ => flint}/nmod_series.pyx (100%) rename src/{ => flint}/pyflint.pxd (97%) rename src/{ => flint}/pyflint.pyx (100%) diff --git a/setup.py b/setup.py index 0a739c9e..126003fd 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ ext_modules = [ Extension( - "flint", ["src/pyflint.pyx"], + "flint._flint", ["src/flint/pyflint.pyx"], libraries=libraries, library_dirs=default_lib_dirs, include_dirs=default_include_dirs) @@ -34,6 +34,8 @@ name='python-flint', cmdclass={'build_ext': build_ext}, ext_modules=ext_modules, + packages=['flint'], + package_dir={'': 'src'}, description='Bindings for FLINT and Arb', version='0.3.0', url='https://github.com/python-flint/python-flint', diff --git a/src/flint/__init__.py b/src/flint/__init__.py new file mode 100644 index 00000000..3e042394 --- /dev/null +++ b/src/flint/__init__.py @@ -0,0 +1 @@ +from ._flint import * diff --git a/src/flint.pxd b/src/flint/_flint.pxd similarity index 100% rename from src/flint.pxd rename to src/flint/_flint.pxd diff --git a/src/acb.pyx b/src/flint/acb.pyx similarity index 100% rename from src/acb.pyx rename to src/flint/acb.pyx diff --git a/src/acb_mat.pyx b/src/flint/acb_mat.pyx similarity index 100% rename from src/acb_mat.pyx rename to src/flint/acb_mat.pyx diff --git a/src/acb_poly.pyx b/src/flint/acb_poly.pyx similarity index 100% rename from src/acb_poly.pyx rename to src/flint/acb_poly.pyx diff --git a/src/acb_series.pyx b/src/flint/acb_series.pyx similarity index 100% rename from src/acb_series.pyx rename to src/flint/acb_series.pyx diff --git a/src/arb.pyx b/src/flint/arb.pyx similarity index 100% rename from src/arb.pyx rename to src/flint/arb.pyx diff --git a/src/arb_mat.pyx b/src/flint/arb_mat.pyx similarity index 100% rename from src/arb_mat.pyx rename to src/flint/arb_mat.pyx diff --git a/src/arb_poly.pyx b/src/flint/arb_poly.pyx similarity index 100% rename from src/arb_poly.pyx rename to src/flint/arb_poly.pyx diff --git a/src/arb_series.pyx b/src/flint/arb_series.pyx similarity index 100% rename from src/arb_series.pyx rename to src/flint/arb_series.pyx diff --git a/src/arf.pyx b/src/flint/arf.pyx similarity index 100% rename from src/arf.pyx rename to src/flint/arf.pyx diff --git a/src/dirichlet.pyx b/src/flint/dirichlet.pyx similarity index 100% rename from src/dirichlet.pyx rename to src/flint/dirichlet.pyx diff --git a/src/fmpq.pyx b/src/flint/fmpq.pyx similarity index 100% rename from src/fmpq.pyx rename to src/flint/fmpq.pyx diff --git a/src/fmpq_mat.pyx b/src/flint/fmpq_mat.pyx similarity index 100% rename from src/fmpq_mat.pyx rename to src/flint/fmpq_mat.pyx diff --git a/src/fmpq_poly.pyx b/src/flint/fmpq_poly.pyx similarity index 100% rename from src/fmpq_poly.pyx rename to src/flint/fmpq_poly.pyx diff --git a/src/fmpq_series.pyx b/src/flint/fmpq_series.pyx similarity index 100% rename from src/fmpq_series.pyx rename to src/flint/fmpq_series.pyx diff --git a/src/fmpz.pyx b/src/flint/fmpz.pyx similarity index 100% rename from src/fmpz.pyx rename to src/flint/fmpz.pyx diff --git a/src/fmpz_mat.pyx b/src/flint/fmpz_mat.pyx similarity index 100% rename from src/fmpz_mat.pyx rename to src/flint/fmpz_mat.pyx diff --git a/src/fmpz_mpoly.pyx b/src/flint/fmpz_mpoly.pyx similarity index 100% rename from src/fmpz_mpoly.pyx rename to src/flint/fmpz_mpoly.pyx diff --git a/src/fmpz_poly.pyx b/src/flint/fmpz_poly.pyx similarity index 100% rename from src/fmpz_poly.pyx rename to src/flint/fmpz_poly.pyx diff --git a/src/fmpz_series.pyx b/src/flint/fmpz_series.pyx similarity index 100% rename from src/fmpz_series.pyx rename to src/flint/fmpz_series.pyx diff --git a/src/functions.pyx b/src/flint/functions.pyx similarity index 100% rename from src/functions.pyx rename to src/flint/functions.pyx diff --git a/src/nmod.pyx b/src/flint/nmod.pyx similarity index 100% rename from src/nmod.pyx rename to src/flint/nmod.pyx diff --git a/src/nmod_mat.pyx b/src/flint/nmod_mat.pyx similarity index 100% rename from src/nmod_mat.pyx rename to src/flint/nmod_mat.pyx diff --git a/src/nmod_poly.pyx b/src/flint/nmod_poly.pyx similarity index 100% rename from src/nmod_poly.pyx rename to src/flint/nmod_poly.pyx diff --git a/src/nmod_series.pyx b/src/flint/nmod_series.pyx similarity index 100% rename from src/nmod_series.pyx rename to src/flint/nmod_series.pyx diff --git a/src/pyflint.pxd b/src/flint/pyflint.pxd similarity index 97% rename from src/pyflint.pxd rename to src/flint/pyflint.pxd index abb861a5..abfe739f 100644 --- a/src/pyflint.pxd +++ b/src/flint/pyflint.pxd @@ -1,4 +1,4 @@ -from flint cimport * +from flint._flint cimport * cdef class Context: cpdef public bint pretty diff --git a/src/pyflint.pyx b/src/flint/pyflint.pyx similarity index 100% rename from src/pyflint.pyx rename to src/flint/pyflint.pyx