* [Buildroot] [PATCH] package/python-pgcopy: new package @ 2024-10-14 1:40 Scott Fan 2024-10-24 0:28 ` [Buildroot] [PATCH v2] " Scott Fan 0 siblings, 1 reply; 11+ messages in thread From: Scott Fan @ 2024-10-14 1:40 UTC (permalink / raw) To: buildroot; +Cc: James Hilliard, Thomas Petazzoni, Asaf Kahlon, Scott Fan Signed-off-by: Scott Fan <fancp2007@gmail.com> --- package/python-pgcopy/Config.in | 17 +++++++++++++++ package/python-pgcopy/python-pgcopy.hash | 5 +++++ package/python-pgcopy/python-pgcopy.mk | 27 ++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 package/python-pgcopy/Config.in create mode 100644 package/python-pgcopy/python-pgcopy.hash create mode 100644 package/python-pgcopy/python-pgcopy.mk diff --git a/package/python-pgcopy/Config.in b/package/python-pgcopy/Config.in new file mode 100644 index 0000000000..60db29d5de --- /dev/null +++ b/package/python-pgcopy/Config.in @@ -0,0 +1,17 @@ +config BR2_PACKAGE_PYTHON_PGCOPY + bool "python-pgcopy" + depends on BR2_USE_WCHAR # postgresql + depends on !BR2_OPTIMIZE_FAST # postgresql + select BR2_PACKAGE_POSTGRESQL + select BR2_PACKAGE_PYTHON_PSYCOPG2 + select BR2_PACKAGE_PYTHON_PYTZ + help + Use pgcopy for fast data loading into PostgreSQL with binary copy. + + https://github.com/altaurog/pgcopy + +comment "python-pgcopy needs a toolchain w/ wchar" + depends on !BR2_USE_WCHAR + +comment "python-pgcopy can't be built with Optimize for fast" + depends on BR2_OPTIMIZE_FAST diff --git a/package/python-pgcopy/python-pgcopy.hash b/package/python-pgcopy/python-pgcopy.hash new file mode 100644 index 0000000000..9fa7990877 --- /dev/null +++ b/package/python-pgcopy/python-pgcopy.hash @@ -0,0 +1,5 @@ +# md5, sha256 from https://pypi.org/pypi/pgcopy/json +md5 bb7940ed821f54f32705c462f7582458 pgcopy-1.6.0.tar.gz +sha256 0da9235eea4ee9ceb4f52b97523bc89db9a6f8e80f897b49214e814ea13d04b0 pgcopy-1.6.0.tar.gz +# Locally computed sha256 checksums +sha256 969191428cb0729e689468bdcd152291a4e168875755c97745cd2df6de5520c1 LICENSE.txt diff --git a/package/python-pgcopy/python-pgcopy.mk b/package/python-pgcopy/python-pgcopy.mk new file mode 100644 index 0000000000..09fd7ea584 --- /dev/null +++ b/package/python-pgcopy/python-pgcopy.mk @@ -0,0 +1,27 @@ +################################################################################ +# +# python-pgcopy +# +################################################################################ + +PYTHON_PGCOPY_VERSION = 1.6.0 +PYTHON_PGCOPY_SOURCE = pgcopy-$(PYTHON_PGCOPY_VERSION).tar.gz +PYTHON_PGCOPY_SITE = https://files.pythonhosted.org/packages/b0/7d/a5c833f921b20cdb1e8538e72a6065bcc67bbb270fa7a35e98f2d397ce0c +PYTHON_PGCOPY_SETUP_TYPE = setuptools +PYTHON_PGCOPY_LICENSE = MIT +PYTHON_PGCOPY_LICENSE_FILES = LICENSE.txt +PYTHON_PGCOPY_DEPENDENCIES = postgresql python-psycopg2 python-pytz + +define PYTHON_PGCOPY_CLEAN_PY2_SCRIPT + $(RM) $(@D)/pgcopy/errors/py2.py +endef +PYTHON_PGCOPY_POST_EXTRACT_HOOKS += PYTHON_PGCOPY_CLEAN_PY2_SCRIPT + +# Force pgcopy to use the Buildroot provided postgresql version +# instead of the one from the host machine +define PYTHON_PGCOPY_CREATE_SETUP_CFG + printf "[build_ext]\ndefine=\npg_config=$(STAGING_DIR)/usr/bin/pg_config\n" > $(@D)/setup.cfg +endef +PYTHON_PGCOPY_PRE_CONFIGURE_HOOKS += PYTHON_PGCOPY_CREATE_SETUP_CFG + +$(eval $(python-package)) -- 2.43.0 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH v2] package/python-pgcopy: new package 2024-10-14 1:40 [Buildroot] [PATCH] package/python-pgcopy: new package Scott Fan @ 2024-10-24 0:28 ` Scott Fan 2024-10-29 5:47 ` [Buildroot] [PATCH v3] " Scott Fan 0 siblings, 1 reply; 11+ messages in thread From: Scott Fan @ 2024-10-24 0:28 UTC (permalink / raw) To: buildroot; +Cc: James Hilliard, Asaf Kahlon, Thomas Petazzoni, Scott Fan Signed-off-by: Scott Fan <fancp2007@gmail.com> --- Changes v1 -> v2: - add missing config menu entry in Config.in Signed-off-by: Scott Fan <fancp2007@gmail.com> --- package/Config.in | 1 + package/python-pgcopy/Config.in | 17 +++++++++++++++ package/python-pgcopy/python-pgcopy.hash | 5 +++++ package/python-pgcopy/python-pgcopy.mk | 27 ++++++++++++++++++++++++ 4 files changed, 50 insertions(+) create mode 100644 package/python-pgcopy/Config.in create mode 100644 package/python-pgcopy/python-pgcopy.hash create mode 100644 package/python-pgcopy/python-pgcopy.mk diff --git a/package/Config.in b/package/Config.in index b43e11b806..76f74815dc 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1254,6 +1254,7 @@ menu "External python modules" source "package/python-pathvalidate/Config.in" source "package/python-periphery/Config.in" source "package/python-pexpect/Config.in" + source "package/python-pgcopy/Config.in" source "package/python-pickleshare/Config.in" source "package/python-piexif/Config.in" source "package/python-pigpio/Config.in" diff --git a/package/python-pgcopy/Config.in b/package/python-pgcopy/Config.in new file mode 100644 index 0000000000..60db29d5de --- /dev/null +++ b/package/python-pgcopy/Config.in @@ -0,0 +1,17 @@ +config BR2_PACKAGE_PYTHON_PGCOPY + bool "python-pgcopy" + depends on BR2_USE_WCHAR # postgresql + depends on !BR2_OPTIMIZE_FAST # postgresql + select BR2_PACKAGE_POSTGRESQL + select BR2_PACKAGE_PYTHON_PSYCOPG2 + select BR2_PACKAGE_PYTHON_PYTZ + help + Use pgcopy for fast data loading into PostgreSQL with binary copy. + + https://github.com/altaurog/pgcopy + +comment "python-pgcopy needs a toolchain w/ wchar" + depends on !BR2_USE_WCHAR + +comment "python-pgcopy can't be built with Optimize for fast" + depends on BR2_OPTIMIZE_FAST diff --git a/package/python-pgcopy/python-pgcopy.hash b/package/python-pgcopy/python-pgcopy.hash new file mode 100644 index 0000000000..9fa7990877 --- /dev/null +++ b/package/python-pgcopy/python-pgcopy.hash @@ -0,0 +1,5 @@ +# md5, sha256 from https://pypi.org/pypi/pgcopy/json +md5 bb7940ed821f54f32705c462f7582458 pgcopy-1.6.0.tar.gz +sha256 0da9235eea4ee9ceb4f52b97523bc89db9a6f8e80f897b49214e814ea13d04b0 pgcopy-1.6.0.tar.gz +# Locally computed sha256 checksums +sha256 969191428cb0729e689468bdcd152291a4e168875755c97745cd2df6de5520c1 LICENSE.txt diff --git a/package/python-pgcopy/python-pgcopy.mk b/package/python-pgcopy/python-pgcopy.mk new file mode 100644 index 0000000000..09fd7ea584 --- /dev/null +++ b/package/python-pgcopy/python-pgcopy.mk @@ -0,0 +1,27 @@ +################################################################################ +# +# python-pgcopy +# +################################################################################ + +PYTHON_PGCOPY_VERSION = 1.6.0 +PYTHON_PGCOPY_SOURCE = pgcopy-$(PYTHON_PGCOPY_VERSION).tar.gz +PYTHON_PGCOPY_SITE = https://files.pythonhosted.org/packages/b0/7d/a5c833f921b20cdb1e8538e72a6065bcc67bbb270fa7a35e98f2d397ce0c +PYTHON_PGCOPY_SETUP_TYPE = setuptools +PYTHON_PGCOPY_LICENSE = MIT +PYTHON_PGCOPY_LICENSE_FILES = LICENSE.txt +PYTHON_PGCOPY_DEPENDENCIES = postgresql python-psycopg2 python-pytz + +define PYTHON_PGCOPY_CLEAN_PY2_SCRIPT + $(RM) $(@D)/pgcopy/errors/py2.py +endef +PYTHON_PGCOPY_POST_EXTRACT_HOOKS += PYTHON_PGCOPY_CLEAN_PY2_SCRIPT + +# Force pgcopy to use the Buildroot provided postgresql version +# instead of the one from the host machine +define PYTHON_PGCOPY_CREATE_SETUP_CFG + printf "[build_ext]\ndefine=\npg_config=$(STAGING_DIR)/usr/bin/pg_config\n" > $(@D)/setup.cfg +endef +PYTHON_PGCOPY_PRE_CONFIGURE_HOOKS += PYTHON_PGCOPY_CREATE_SETUP_CFG + +$(eval $(python-package)) -- 2.43.0 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH v3] package/python-pgcopy: new package 2024-10-24 0:28 ` [Buildroot] [PATCH v2] " Scott Fan @ 2024-10-29 5:47 ` Scott Fan 2024-10-29 18:50 ` Thomas Petazzoni via buildroot 2024-10-30 13:43 ` [Buildroot] [PATCH v4] " Scott Fan 0 siblings, 2 replies; 11+ messages in thread From: Scott Fan @ 2024-10-29 5:47 UTC (permalink / raw) To: buildroot; +Cc: James Hilliard, Asaf Kahlon, Thomas Petazzoni, Scott Fan Signed-off-by: Scott Fan <fancp2007@gmail.com> --- Changes v1 -> v2: - add missing config menu entry in Config.in Changes v2 -> v3: - fix help text indent in Config.in --- package/Config.in | 1 + package/python-pgcopy/Config.in | 18 ++++++++++++++++ package/python-pgcopy/python-pgcopy.hash | 5 +++++ package/python-pgcopy/python-pgcopy.mk | 27 ++++++++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 package/python-pgcopy/Config.in create mode 100644 package/python-pgcopy/python-pgcopy.hash create mode 100644 package/python-pgcopy/python-pgcopy.mk diff --git a/package/Config.in b/package/Config.in index 72b8d8bdc9..cd7d274100 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1258,6 +1258,7 @@ menu "External python modules" source "package/python-pathvalidate/Config.in" source "package/python-periphery/Config.in" source "package/python-pexpect/Config.in" + source "package/python-pgcopy/Config.in" source "package/python-pickleshare/Config.in" source "package/python-piexif/Config.in" source "package/python-pigpio/Config.in" diff --git a/package/python-pgcopy/Config.in b/package/python-pgcopy/Config.in new file mode 100644 index 0000000000..b5bde7c3b0 --- /dev/null +++ b/package/python-pgcopy/Config.in @@ -0,0 +1,18 @@ +config BR2_PACKAGE_PYTHON_PGCOPY + bool "python-pgcopy" + depends on BR2_USE_WCHAR # postgresql + depends on !BR2_OPTIMIZE_FAST # postgresql + select BR2_PACKAGE_POSTGRESQL + select BR2_PACKAGE_PYTHON_PSYCOPG2 + select BR2_PACKAGE_PYTHON_PYTZ + help + Use pgcopy for fast data loading into PostgreSQL with + binary copy. + + https://github.com/altaurog/pgcopy + +comment "python-pgcopy needs a toolchain w/ wchar" + depends on !BR2_USE_WCHAR + +comment "python-pgcopy can't be built with Optimize for fast" + depends on BR2_OPTIMIZE_FAST diff --git a/package/python-pgcopy/python-pgcopy.hash b/package/python-pgcopy/python-pgcopy.hash new file mode 100644 index 0000000000..9fa7990877 --- /dev/null +++ b/package/python-pgcopy/python-pgcopy.hash @@ -0,0 +1,5 @@ +# md5, sha256 from https://pypi.org/pypi/pgcopy/json +md5 bb7940ed821f54f32705c462f7582458 pgcopy-1.6.0.tar.gz +sha256 0da9235eea4ee9ceb4f52b97523bc89db9a6f8e80f897b49214e814ea13d04b0 pgcopy-1.6.0.tar.gz +# Locally computed sha256 checksums +sha256 969191428cb0729e689468bdcd152291a4e168875755c97745cd2df6de5520c1 LICENSE.txt diff --git a/package/python-pgcopy/python-pgcopy.mk b/package/python-pgcopy/python-pgcopy.mk new file mode 100644 index 0000000000..09fd7ea584 --- /dev/null +++ b/package/python-pgcopy/python-pgcopy.mk @@ -0,0 +1,27 @@ +################################################################################ +# +# python-pgcopy +# +################################################################################ + +PYTHON_PGCOPY_VERSION = 1.6.0 +PYTHON_PGCOPY_SOURCE = pgcopy-$(PYTHON_PGCOPY_VERSION).tar.gz +PYTHON_PGCOPY_SITE = https://files.pythonhosted.org/packages/b0/7d/a5c833f921b20cdb1e8538e72a6065bcc67bbb270fa7a35e98f2d397ce0c +PYTHON_PGCOPY_SETUP_TYPE = setuptools +PYTHON_PGCOPY_LICENSE = MIT +PYTHON_PGCOPY_LICENSE_FILES = LICENSE.txt +PYTHON_PGCOPY_DEPENDENCIES = postgresql python-psycopg2 python-pytz + +define PYTHON_PGCOPY_CLEAN_PY2_SCRIPT + $(RM) $(@D)/pgcopy/errors/py2.py +endef +PYTHON_PGCOPY_POST_EXTRACT_HOOKS += PYTHON_PGCOPY_CLEAN_PY2_SCRIPT + +# Force pgcopy to use the Buildroot provided postgresql version +# instead of the one from the host machine +define PYTHON_PGCOPY_CREATE_SETUP_CFG + printf "[build_ext]\ndefine=\npg_config=$(STAGING_DIR)/usr/bin/pg_config\n" > $(@D)/setup.cfg +endef +PYTHON_PGCOPY_PRE_CONFIGURE_HOOKS += PYTHON_PGCOPY_CREATE_SETUP_CFG + +$(eval $(python-package)) -- 2.43.0 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH v3] package/python-pgcopy: new package 2024-10-29 5:47 ` [Buildroot] [PATCH v3] " Scott Fan @ 2024-10-29 18:50 ` Thomas Petazzoni via buildroot 2024-10-30 13:28 ` Scott Fan 2024-10-30 13:43 ` [Buildroot] [PATCH v4] " Scott Fan 1 sibling, 1 reply; 11+ messages in thread From: Thomas Petazzoni via buildroot @ 2024-10-29 18:50 UTC (permalink / raw) To: Scott Fan; +Cc: buildroot, James Hilliard, Asaf Kahlon Hello Scott, Thanks for this new iteration! Some small comments/questions below. James: if you could review, if would be very helpful. Thanks! On Tue, 29 Oct 2024 13:47:11 +0800 Scott Fan <fancp2007@gmail.com> wrote: > package/Config.in | 1 + > package/python-pgcopy/Config.in | 18 ++++++++++++++++ > package/python-pgcopy/python-pgcopy.hash | 5 +++++ > package/python-pgcopy/python-pgcopy.mk | 27 ++++++++++++++++++++++++ > 4 files changed, 51 insertions(+) An entry in the DEVELOPERS file should be added. > diff --git a/package/python-pgcopy/Config.in b/package/python-pgcopy/Config.in > new file mode 100644 > index 0000000000..b5bde7c3b0 > --- /dev/null > +++ b/package/python-pgcopy/Config.in > @@ -0,0 +1,18 @@ > +config BR2_PACKAGE_PYTHON_PGCOPY > + bool "python-pgcopy" > + depends on BR2_USE_WCHAR # postgresql > + depends on !BR2_OPTIMIZE_FAST # postgresql You also need BR2_USE_MMU from postgresql, and !BR2_STATIC_LIBS from postgresql. > diff --git a/package/python-pgcopy/python-pgcopy.mk b/package/python-pgcopy/python-pgcopy.mk > new file mode 100644 > index 0000000000..09fd7ea584 > --- /dev/null > +++ b/package/python-pgcopy/python-pgcopy.mk > @@ -0,0 +1,27 @@ > +################################################################################ > +# > +# python-pgcopy > +# > +################################################################################ > + > +PYTHON_PGCOPY_VERSION = 1.6.0 > +PYTHON_PGCOPY_SOURCE = pgcopy-$(PYTHON_PGCOPY_VERSION).tar.gz > +PYTHON_PGCOPY_SITE = https://files.pythonhosted.org/packages/b0/7d/a5c833f921b20cdb1e8538e72a6065bcc67bbb270fa7a35e98f2d397ce0c > +PYTHON_PGCOPY_SETUP_TYPE = setuptools > +PYTHON_PGCOPY_LICENSE = MIT > +PYTHON_PGCOPY_LICENSE_FILES = LICENSE.txt > +PYTHON_PGCOPY_DEPENDENCIES = postgresql python-psycopg2 python-pytz Are you sure python-psycopg2 and python-pytz are build-time dependencies? I.e are they needed during the build, or only at runtime? > +define PYTHON_PGCOPY_CLEAN_PY2_SCRIPT > + $(RM) $(@D)/pgcopy/errors/py2.py > +endef > +PYTHON_PGCOPY_POST_EXTRACT_HOOKS += PYTHON_PGCOPY_CLEAN_PY2_SCRIPT What is this hook needed? A small comment would be useful. > + > +# Force pgcopy to use the Buildroot provided postgresql version > +# instead of the one from the host machine > +define PYTHON_PGCOPY_CREATE_SETUP_CFG > + printf "[build_ext]\ndefine=\npg_config=$(STAGING_DIR)/usr/bin/pg_config\n" > $(@D)/setup.cfg > +endef > +PYTHON_PGCOPY_PRE_CONFIGURE_HOOKS += PYTHON_PGCOPY_CREATE_SETUP_CFG > + > +$(eval $(python-package)) Otherwise, sounds reasonable to me. Thanks! Thomas -- Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH v3] package/python-pgcopy: new package 2024-10-29 18:50 ` Thomas Petazzoni via buildroot @ 2024-10-30 13:28 ` Scott Fan 2024-10-30 13:35 ` Thomas Petazzoni via buildroot 0 siblings, 1 reply; 11+ messages in thread From: Scott Fan @ 2024-10-30 13:28 UTC (permalink / raw) To: Thomas Petazzoni; +Cc: buildroot, James Hilliard, Asaf Kahlon Hi Thomas, Thanks for your review. On Wed, Oct 30, 2024 at 2:50 AM Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote: > > Hello Scott, > > Thanks for this new iteration! Some small comments/questions below. > > James: if you could review, if would be very helpful. Thanks! > > On Tue, 29 Oct 2024 13:47:11 +0800 > Scott Fan <fancp2007@gmail.com> wrote: > > > package/Config.in | 1 + > > package/python-pgcopy/Config.in | 18 ++++++++++++++++ > > package/python-pgcopy/python-pgcopy.hash | 5 +++++ > > package/python-pgcopy/python-pgcopy.mk | 27 ++++++++++++++++++++++++ > > 4 files changed, 51 insertions(+) > > An entry in the DEVELOPERS file should be added. I'll add one entry for me later. > > > > diff --git a/package/python-pgcopy/Config.in b/package/python-pgcopy/Config.in > > new file mode 100644 > > index 0000000000..b5bde7c3b0 > > --- /dev/null > > +++ b/package/python-pgcopy/Config.in > > @@ -0,0 +1,18 @@ > > +config BR2_PACKAGE_PYTHON_PGCOPY > > + bool "python-pgcopy" > > + depends on BR2_USE_WCHAR # postgresql > > + depends on !BR2_OPTIMIZE_FAST # postgresql > > You also need BR2_USE_MMU from postgresql, and !BR2_STATIC_LIBS from > postgresql. I'll fix it later. Thanks for your reminder. > > > > diff --git a/package/python-pgcopy/python-pgcopy.mk b/package/python-pgcopy/python-pgcopy.mk > > new file mode 100644 > > index 0000000000..09fd7ea584 > > --- /dev/null > > +++ b/package/python-pgcopy/python-pgcopy.mk > > @@ -0,0 +1,27 @@ > > +################################################################################ > > +# > > +# python-pgcopy > > +# > > +################################################################################ > > + > > +PYTHON_PGCOPY_VERSION = 1.6.0 > > +PYTHON_PGCOPY_SOURCE = pgcopy-$(PYTHON_PGCOPY_VERSION).tar.gz > > +PYTHON_PGCOPY_SITE = https://files.pythonhosted.org/packages/b0/7d/a5c833f921b20cdb1e8538e72a6065bcc67bbb270fa7a35e98f2d397ce0c > > +PYTHON_PGCOPY_SETUP_TYPE = setuptools > > +PYTHON_PGCOPY_LICENSE = MIT > > +PYTHON_PGCOPY_LICENSE_FILES = LICENSE.txt > > +PYTHON_PGCOPY_DEPENDENCIES = postgresql python-psycopg2 python-pytz > > Are you sure python-psycopg2 and python-pytz are build-time > dependencies? I.e are they needed during the build, or only at runtime? In pgcopy's setup.py file, has the next line: install_requires=["psycopg2", "pytz"] So I understand, those are build-time dependencies. Meanwhile, the psycopg2 module depends on postgres. Do I need to remove postgres dependency from this package? > > > +define PYTHON_PGCOPY_CLEAN_PY2_SCRIPT > > + $(RM) $(@D)/pgcopy/errors/py2.py > > +endef > > +PYTHON_PGCOPY_POST_EXTRACT_HOOKS += PYTHON_PGCOPY_CLEAN_PY2_SCRIPT > > What is this hook needed? A small comment would be useful. The py2.py file is just for Python 2, it will cause compilation errors in Buildroot: File "/usr/lib/python3.12/site-packages/pgcopy/errors/py2.py", line 19 raise newexc, None, sys.exc_info()[2] ^ SyntaxError: invalid syntax I'll add a comment before the hook definition. > > > + > > +# Force pgcopy to use the Buildroot provided postgresql version > > +# instead of the one from the host machine > > +define PYTHON_PGCOPY_CREATE_SETUP_CFG > > + printf "[build_ext]\ndefine=\npg_config=$(STAGING_DIR)/usr/bin/pg_config\n" > $(@D)/setup.cfg > > +endef > > +PYTHON_PGCOPY_PRE_CONFIGURE_HOOKS += PYTHON_PGCOPY_CREATE_SETUP_CFG This hook will be removed, i copied it from package/python-psycopg2, It is redundant. > > + > > +$(eval $(python-package)) > > Otherwise, sounds reasonable to me. Scott Fan _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH v3] package/python-pgcopy: new package 2024-10-30 13:28 ` Scott Fan @ 2024-10-30 13:35 ` Thomas Petazzoni via buildroot 0 siblings, 0 replies; 11+ messages in thread From: Thomas Petazzoni via buildroot @ 2024-10-30 13:35 UTC (permalink / raw) To: Scott Fan; +Cc: buildroot, James Hilliard, Asaf Kahlon Hello Scott, James: question for you below. On Wed, 30 Oct 2024 21:28:24 +0800 Scott Fan <fancp2007@gmail.com> wrote: > > Are you sure python-psycopg2 and python-pytz are build-time > > dependencies? I.e are they needed during the build, or only at runtime? > > In pgcopy's setup.py file, has the next line: > install_requires=["psycopg2", "pytz"] > > So I understand, those are build-time dependencies. I'll let James comment on this, but I believe install_requires are run-time dependencies, not build-time dependencies. > Meanwhile, the psycopg2 module depends on postgres. > Do I need to remove postgres dependency from this package? If you select BR2_PACKAGE_PYTHON_PSYCOPG2, it will automatically select BR2_PACKAGE_POSTGRESQL. Now whether you need postgresql as a build-time dependency or not depends on whether your package is building native code that links against Postgresql libraries. > > What is this hook needed? A small comment would be useful. > > The py2.py file is just for Python 2, it will cause compilation errors > in Buildroot: > File "/usr/lib/python3.12/site-packages/pgcopy/errors/py2.py", line 19 > raise newexc, None, sys.exc_info()[2] > ^ > SyntaxError: invalid syntax > > I'll add a comment before the hook definition. Yes, good. > This hook will be removed, i copied it from package/python-psycopg2, > It is redundant. Thanks! Thomas -- Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH v4] package/python-pgcopy: new package 2024-10-29 5:47 ` [Buildroot] [PATCH v3] " Scott Fan 2024-10-29 18:50 ` Thomas Petazzoni via buildroot @ 2024-10-30 13:43 ` Scott Fan 2024-10-30 14:59 ` [Buildroot] [PATCH v5 1/2] package/python-psycopg2: add config dependencies from postgresql Scott Fan 1 sibling, 1 reply; 11+ messages in thread From: Scott Fan @ 2024-10-30 13:43 UTC (permalink / raw) To: buildroot; +Cc: James Hilliard, Thomas Petazzoni, Asaf Kahlon, Scott Fan Signed-off-by: Scott Fan <fancp2007@gmail.com> --- Changes v1 -> v2: - add missing config menu entry in Config.in Changes v2 -> v3: - fix help text indent in Config.in Changes v3 -> v4: - add missing dependencies in the Config.in file - add a comment for the hook PYTHON_PGCOPY_CLEAN_PY2_SCRIPT - remove the pre configure hook PYTHON_PGCOPY_CREATE_SETUP_CFG --- DEVELOPERS | 3 +++ package/Config.in | 1 + package/python-pgcopy/Config.in | 21 +++++++++++++++++++++ package/python-pgcopy/python-pgcopy.hash | 5 +++++ package/python-pgcopy/python-pgcopy.mk | 21 +++++++++++++++++++++ 5 files changed, 51 insertions(+) create mode 100644 package/python-pgcopy/Config.in create mode 100644 package/python-pgcopy/python-pgcopy.hash create mode 100644 package/python-pgcopy/python-pgcopy.mk diff --git a/DEVELOPERS b/DEVELOPERS index 76f15f708a..f7cfbf3ad5 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -2923,6 +2923,9 @@ F: package/lrzip/ N: Sam Voss <sam.voss@gmail.com> F: package/ripgrep/ +N: Scott Fan <fancp2007@gmail.com> +F: package/python-pgcopy/ + N: Sébastien Szymanski <sebastien.szymanski@armadeus.com> F: board/armadeus/ F: configs/armadeus* diff --git a/package/Config.in b/package/Config.in index b1e999a63b..eda877bce3 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1259,6 +1259,7 @@ menu "External python modules" source "package/python-pathvalidate/Config.in" source "package/python-periphery/Config.in" source "package/python-pexpect/Config.in" + source "package/python-pgcopy/Config.in" source "package/python-pickleshare/Config.in" source "package/python-piexif/Config.in" source "package/python-pigpio/Config.in" diff --git a/package/python-pgcopy/Config.in b/package/python-pgcopy/Config.in new file mode 100644 index 0000000000..6f4ab5544f --- /dev/null +++ b/package/python-pgcopy/Config.in @@ -0,0 +1,21 @@ +config BR2_PACKAGE_PYTHON_PGCOPY + bool "python-pgcopy" + depends on BR2_USE_MMU # postgresql + depends on BR2_USE_WCHAR # postgresql + depends on !BR2_STATIC_LIBS # postgresql + depends on !BR2_OPTIMIZE_FAST # postgresql + select BR2_PACKAGE_POSTGRESQL + select BR2_PACKAGE_PYTHON_PSYCOPG2 + select BR2_PACKAGE_PYTHON_PYTZ + help + Use pgcopy for fast data loading into PostgreSQL with + binary copy. + + https://github.com/altaurog/pgcopy + +comment "python-pgcopy needs a toolchain w/ dynamic library, wchar" + depends on BR2_USE_MMU + depends on BR2_STATIC_LIBS || !BR2_USE_WCHAR + +comment "python-pgcopy can't be built with Optimize for fast" + depends on BR2_OPTIMIZE_FAST diff --git a/package/python-pgcopy/python-pgcopy.hash b/package/python-pgcopy/python-pgcopy.hash new file mode 100644 index 0000000000..9fa7990877 --- /dev/null +++ b/package/python-pgcopy/python-pgcopy.hash @@ -0,0 +1,5 @@ +# md5, sha256 from https://pypi.org/pypi/pgcopy/json +md5 bb7940ed821f54f32705c462f7582458 pgcopy-1.6.0.tar.gz +sha256 0da9235eea4ee9ceb4f52b97523bc89db9a6f8e80f897b49214e814ea13d04b0 pgcopy-1.6.0.tar.gz +# Locally computed sha256 checksums +sha256 969191428cb0729e689468bdcd152291a4e168875755c97745cd2df6de5520c1 LICENSE.txt diff --git a/package/python-pgcopy/python-pgcopy.mk b/package/python-pgcopy/python-pgcopy.mk new file mode 100644 index 0000000000..276ef77e7e --- /dev/null +++ b/package/python-pgcopy/python-pgcopy.mk @@ -0,0 +1,21 @@ +################################################################################ +# +# python-pgcopy +# +################################################################################ + +PYTHON_PGCOPY_VERSION = 1.6.0 +PYTHON_PGCOPY_SOURCE = pgcopy-$(PYTHON_PGCOPY_VERSION).tar.gz +PYTHON_PGCOPY_SITE = https://files.pythonhosted.org/packages/b0/7d/a5c833f921b20cdb1e8538e72a6065bcc67bbb270fa7a35e98f2d397ce0c +PYTHON_PGCOPY_SETUP_TYPE = setuptools +PYTHON_PGCOPY_LICENSE = MIT +PYTHON_PGCOPY_LICENSE_FILES = LICENSE.txt +PYTHON_PGCOPY_DEPENDENCIES = postgresql python-psycopg2 python-pytz + +# Remove the file only for Python 2, it will cause compilation errors +define PYTHON_PGCOPY_CLEAN_PY2_SCRIPT + $(RM) $(@D)/pgcopy/errors/py2.py +endef +PYTHON_PGCOPY_POST_EXTRACT_HOOKS += PYTHON_PGCOPY_CLEAN_PY2_SCRIPT + +$(eval $(python-package)) -- 2.43.0 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH v5 1/2] package/python-psycopg2: add config dependencies from postgresql 2024-10-30 13:43 ` [Buildroot] [PATCH v4] " Scott Fan @ 2024-10-30 14:59 ` Scott Fan 2024-10-30 14:59 ` [Buildroot] [PATCH v5 2/2] package/python-pgcopy: new package Scott Fan 2024-10-30 15:11 ` [Buildroot] [PATCH v2] package/python-psycopg2: add config dependencies from postgresql Scott Fan 0 siblings, 2 replies; 11+ messages in thread From: Scott Fan @ 2024-10-30 14:59 UTC (permalink / raw) To: buildroot; +Cc: James Hilliard, Asaf Kahlon, Scott Fan Also update site url to https://www.psycopg.org/ Signed-off-by: Scott Fan <fancp2007@gmail.com> --- package/python-psycopg2/Config.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/package/python-psycopg2/Config.in b/package/python-psycopg2/Config.in index 4aa86c7690..d70a89a6aa 100644 --- a/package/python-psycopg2/Config.in +++ b/package/python-psycopg2/Config.in @@ -1,6 +1,8 @@ config BR2_PACKAGE_PYTHON_PSYCOPG2 bool "python-psycopg2" + depends on BR2_USE_MMU # postgresql depends on BR2_USE_WCHAR # postgresql + depends on !BR2_STATIC_LIBS # postgresql depends on !BR2_OPTIMIZE_FAST # postgresql select BR2_PACKAGE_POSTGRESQL help @@ -21,10 +23,11 @@ config BR2_PACKAGE_PYTHON_PSYCOPG2 customized thanks to a flexible objects adaptation system. Psycopg 2 is both Unicode and Python 3 friendly. - http://initd.org/psycopg/ + https://www.psycopg.org/ -comment "python-psycopg2 needs a toolchain w/ wchar" - depends on !BR2_USE_WCHAR +comment "python-psycopg2 needs a toolchain w/ dynamic library, wchar" + depends on BR2_USE_MMU + depends on BR2_STATIC_LIBS || !BR2_USE_WCHAR comment "python-psycopg2 can't be built with Optimize for fast" depends on BR2_OPTIMIZE_FAST -- 2.43.0 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH v5 2/2] package/python-pgcopy: new package 2024-10-30 14:59 ` [Buildroot] [PATCH v5 1/2] package/python-psycopg2: add config dependencies from postgresql Scott Fan @ 2024-10-30 14:59 ` Scott Fan 2024-10-30 15:11 ` [Buildroot] [PATCH v2] package/python-psycopg2: add config dependencies from postgresql Scott Fan 1 sibling, 0 replies; 11+ messages in thread From: Scott Fan @ 2024-10-30 14:59 UTC (permalink / raw) To: buildroot; +Cc: James Hilliard, Thomas Petazzoni, Asaf Kahlon, Scott Fan Signed-off-by: Scott Fan <fancp2007@gmail.com> --- Changes v1 -> v2: - add missing config menu entry in Config.in Changes v2 -> v3: - fix help text indent in Config.in Changes v3 -> v4: - add missing dependencies in the Config.in file - add a comment for the hook PYTHON_PGCOPY_CLEAN_PY2_SCRIPT - remove the pre configure hook PYTHON_PGCOPY_CREATE_SETUP_CFG Changes v4 -> v5: - remove the postgresql dependency, python-psycopg2 has select it --- DEVELOPERS | 3 +++ package/Config.in | 1 + package/python-pgcopy/Config.in | 20 ++++++++++++++++++++ package/python-pgcopy/python-pgcopy.hash | 5 +++++ package/python-pgcopy/python-pgcopy.mk | 21 +++++++++++++++++++++ 5 files changed, 50 insertions(+) create mode 100644 package/python-pgcopy/Config.in create mode 100644 package/python-pgcopy/python-pgcopy.hash create mode 100644 package/python-pgcopy/python-pgcopy.mk diff --git a/DEVELOPERS b/DEVELOPERS index 76f15f708a..f7cfbf3ad5 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -2923,6 +2923,9 @@ F: package/lrzip/ N: Sam Voss <sam.voss@gmail.com> F: package/ripgrep/ +N: Scott Fan <fancp2007@gmail.com> +F: package/python-pgcopy/ + N: Sébastien Szymanski <sebastien.szymanski@armadeus.com> F: board/armadeus/ F: configs/armadeus* diff --git a/package/Config.in b/package/Config.in index b1e999a63b..eda877bce3 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1259,6 +1259,7 @@ menu "External python modules" source "package/python-pathvalidate/Config.in" source "package/python-periphery/Config.in" source "package/python-pexpect/Config.in" + source "package/python-pgcopy/Config.in" source "package/python-pickleshare/Config.in" source "package/python-piexif/Config.in" source "package/python-pigpio/Config.in" diff --git a/package/python-pgcopy/Config.in b/package/python-pgcopy/Config.in new file mode 100644 index 0000000000..424860899e --- /dev/null +++ b/package/python-pgcopy/Config.in @@ -0,0 +1,20 @@ +config BR2_PACKAGE_PYTHON_PGCOPY + bool "python-pgcopy" + depends on BR2_USE_MMU # python-psycopg2 + depends on BR2_USE_WCHAR # python-psycopg2 + depends on !BR2_STATIC_LIBS # python-psycopg2 + depends on !BR2_OPTIMIZE_FAST # python-psycopg2 + select BR2_PACKAGE_PYTHON_PSYCOPG2 + select BR2_PACKAGE_PYTHON_PYTZ + help + Use pgcopy for fast data loading into PostgreSQL with + binary copy. + + https://github.com/altaurog/pgcopy + +comment "python-pgcopy needs a toolchain w/ dynamic library, wchar" + depends on BR2_USE_MMU + depends on BR2_STATIC_LIBS || !BR2_USE_WCHAR + +comment "python-pgcopy can't be built with Optimize for fast" + depends on BR2_OPTIMIZE_FAST diff --git a/package/python-pgcopy/python-pgcopy.hash b/package/python-pgcopy/python-pgcopy.hash new file mode 100644 index 0000000000..9fa7990877 --- /dev/null +++ b/package/python-pgcopy/python-pgcopy.hash @@ -0,0 +1,5 @@ +# md5, sha256 from https://pypi.org/pypi/pgcopy/json +md5 bb7940ed821f54f32705c462f7582458 pgcopy-1.6.0.tar.gz +sha256 0da9235eea4ee9ceb4f52b97523bc89db9a6f8e80f897b49214e814ea13d04b0 pgcopy-1.6.0.tar.gz +# Locally computed sha256 checksums +sha256 969191428cb0729e689468bdcd152291a4e168875755c97745cd2df6de5520c1 LICENSE.txt diff --git a/package/python-pgcopy/python-pgcopy.mk b/package/python-pgcopy/python-pgcopy.mk new file mode 100644 index 0000000000..376f8649a9 --- /dev/null +++ b/package/python-pgcopy/python-pgcopy.mk @@ -0,0 +1,21 @@ +################################################################################ +# +# python-pgcopy +# +################################################################################ + +PYTHON_PGCOPY_VERSION = 1.6.0 +PYTHON_PGCOPY_SOURCE = pgcopy-$(PYTHON_PGCOPY_VERSION).tar.gz +PYTHON_PGCOPY_SITE = https://files.pythonhosted.org/packages/b0/7d/a5c833f921b20cdb1e8538e72a6065bcc67bbb270fa7a35e98f2d397ce0c +PYTHON_PGCOPY_SETUP_TYPE = setuptools +PYTHON_PGCOPY_LICENSE = MIT +PYTHON_PGCOPY_LICENSE_FILES = LICENSE.txt +PYTHON_PGCOPY_DEPENDENCIES = python-psycopg2 python-pytz + +# Remove the file only for Python 2, it will cause compilation errors +define PYTHON_PGCOPY_CLEAN_PY2_SCRIPT + $(RM) $(@D)/pgcopy/errors/py2.py +endef +PYTHON_PGCOPY_POST_EXTRACT_HOOKS += PYTHON_PGCOPY_CLEAN_PY2_SCRIPT + +$(eval $(python-package)) -- 2.43.0 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [Buildroot] [PATCH v2] package/python-psycopg2: add config dependencies from postgresql 2024-10-30 14:59 ` [Buildroot] [PATCH v5 1/2] package/python-psycopg2: add config dependencies from postgresql Scott Fan 2024-10-30 14:59 ` [Buildroot] [PATCH v5 2/2] package/python-pgcopy: new package Scott Fan @ 2024-10-30 15:11 ` Scott Fan 2024-12-04 20:12 ` Arnout Vandecappelle via buildroot 1 sibling, 1 reply; 11+ messages in thread From: Scott Fan @ 2024-10-30 15:11 UTC (permalink / raw) To: buildroot; +Cc: James Hilliard, Asaf Kahlon, Scott Fan Also update site url to https://github.com/psycopg/psycopg2/ Signed-off-by: Scott Fan <fancp2007@gmail.com> --- Changes v1 -> v2: - update site url in the Config.in file --- package/python-psycopg2/Config.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/package/python-psycopg2/Config.in b/package/python-psycopg2/Config.in index 4aa86c7690..6b07b0c06c 100644 --- a/package/python-psycopg2/Config.in +++ b/package/python-psycopg2/Config.in @@ -1,6 +1,8 @@ config BR2_PACKAGE_PYTHON_PSYCOPG2 bool "python-psycopg2" + depends on BR2_USE_MMU # postgresql depends on BR2_USE_WCHAR # postgresql + depends on !BR2_STATIC_LIBS # postgresql depends on !BR2_OPTIMIZE_FAST # postgresql select BR2_PACKAGE_POSTGRESQL help @@ -21,10 +23,11 @@ config BR2_PACKAGE_PYTHON_PSYCOPG2 customized thanks to a flexible objects adaptation system. Psycopg 2 is both Unicode and Python 3 friendly. - http://initd.org/psycopg/ + https://github.com/psycopg/psycopg2/ -comment "python-psycopg2 needs a toolchain w/ wchar" - depends on !BR2_USE_WCHAR +comment "python-psycopg2 needs a toolchain w/ dynamic library, wchar" + depends on BR2_USE_MMU + depends on BR2_STATIC_LIBS || !BR2_USE_WCHAR comment "python-psycopg2 can't be built with Optimize for fast" depends on BR2_OPTIMIZE_FAST -- 2.43.0 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [Buildroot] [PATCH v2] package/python-psycopg2: add config dependencies from postgresql 2024-10-30 15:11 ` [Buildroot] [PATCH v2] package/python-psycopg2: add config dependencies from postgresql Scott Fan @ 2024-12-04 20:12 ` Arnout Vandecappelle via buildroot 0 siblings, 0 replies; 11+ messages in thread From: Arnout Vandecappelle via buildroot @ 2024-12-04 20:12 UTC (permalink / raw) To: Scott Fan, buildroot; +Cc: James Hilliard, Asaf Kahlon On 30/10/2024 16:11, Scott Fan wrote: > Also update site url to https://github.com/psycopg/psycopg2/ > > Signed-off-by: Scott Fan <fancp2007@gmail.com> Applied to master, thanks. Regards, Arnout > > --- > Changes v1 -> v2: > - update site url in the Config.in file > --- > package/python-psycopg2/Config.in | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/package/python-psycopg2/Config.in b/package/python-psycopg2/Config.in > index 4aa86c7690..6b07b0c06c 100644 > --- a/package/python-psycopg2/Config.in > +++ b/package/python-psycopg2/Config.in > @@ -1,6 +1,8 @@ > config BR2_PACKAGE_PYTHON_PSYCOPG2 > bool "python-psycopg2" > + depends on BR2_USE_MMU # postgresql > depends on BR2_USE_WCHAR # postgresql > + depends on !BR2_STATIC_LIBS # postgresql > depends on !BR2_OPTIMIZE_FAST # postgresql > select BR2_PACKAGE_POSTGRESQL > help > @@ -21,10 +23,11 @@ config BR2_PACKAGE_PYTHON_PSYCOPG2 > customized thanks to a flexible objects adaptation system. > Psycopg 2 is both Unicode and Python 3 friendly. > > - http://initd.org/psycopg/ > + https://github.com/psycopg/psycopg2/ > > -comment "python-psycopg2 needs a toolchain w/ wchar" > - depends on !BR2_USE_WCHAR > +comment "python-psycopg2 needs a toolchain w/ dynamic library, wchar" > + depends on BR2_USE_MMU > + depends on BR2_STATIC_LIBS || !BR2_USE_WCHAR > > comment "python-psycopg2 can't be built with Optimize for fast" > depends on BR2_OPTIMIZE_FAST _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-12-04 20:12 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-10-14 1:40 [Buildroot] [PATCH] package/python-pgcopy: new package Scott Fan 2024-10-24 0:28 ` [Buildroot] [PATCH v2] " Scott Fan 2024-10-29 5:47 ` [Buildroot] [PATCH v3] " Scott Fan 2024-10-29 18:50 ` Thomas Petazzoni via buildroot 2024-10-30 13:28 ` Scott Fan 2024-10-30 13:35 ` Thomas Petazzoni via buildroot 2024-10-30 13:43 ` [Buildroot] [PATCH v4] " Scott Fan 2024-10-30 14:59 ` [Buildroot] [PATCH v5 1/2] package/python-psycopg2: add config dependencies from postgresql Scott Fan 2024-10-30 14:59 ` [Buildroot] [PATCH v5 2/2] package/python-pgcopy: new package Scott Fan 2024-10-30 15:11 ` [Buildroot] [PATCH v2] package/python-psycopg2: add config dependencies from postgresql Scott Fan 2024-12-04 20:12 ` Arnout Vandecappelle via buildroot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox