Skip to content

Commit

Permalink
Update supported python and postgres versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ettanany committed Jun 17, 2024
1 parent d28945a commit a34cd3c
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
strategy:
max-parallel: 5
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- id: checkout-code
Expand Down
18 changes: 9 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Requirements
============

PGHoard can backup and restore PostgreSQL versions 9.6 and above, but is
only tested and actively developed with version 10 and above.
only tested and actively developed with version 12 and above.

The daemon is implemented in Python and is tested and developed with version
3.8 and above. The following Python modules are required:
Expand Down Expand Up @@ -128,35 +128,35 @@ Vagrant
=======

The Vagrantfile can be used to setup a vagrant development environment. The vagrant environment has
python 3.8, 3.9 and 3.10 virtual environments and installations of postgresql 10, 11 and 12, 13 and 14.
python 3.8, 3.9, 3.10, 3.11 and 3.12 virtual environments and installations of postgresql 12, 13, 14, 15 and 16.

By default vagrant up will start a Virtualbox environment. The Vagrantfile will also work for libvirt, just prefix
``VAGRANT_DEFAULT_PROVIDER=libvirt`` to the ``vagrant up`` command.

Any combination of Python (3.8, 3.9 and 3.10) and Postgresql (10, 11, 12, 13 and 14)
Any combination of Python (3.8, 3.9, 3.10, 3.11 and 3.12) and Postgresql (12, 13, 14, 15 and 16)

Bring up vagrant instance and connect via ssh::

vagrant up
vagrant ssh
vagrant@ubuntu2004:~$ cd /vagrant

Test with Python 3.8 and Postgresql 11::
Test with Python 3.8 and Postgresql 12::

vagrant@ubuntu2004:~$ source ~/venv3.8/bin/activate
vagrant@ubuntu2004:~$ PG_VERSION=11 make unittest
vagrant@ubuntu2004:~$ PG_VERSION=12 make unittest
vagrant@ubuntu2004:~$ deactivate

Test with Python 3.9 and Postgresql 12::
Test with Python 3.9 and Postgresql 13::

vagrant@ubuntu2004:~$ source ~/venv3.9/bin/activate
vagrant@ubuntu2004:~$ PG_VERSION=12 make unittest
vagrant@ubuntu2004:~$ PG_VERSION=13 make unittest
vagrant@ubuntu2004:~$ deactivate

Test with Python 3.10 and Postgresql 13::
Test with Python 3.10 and Postgresql 14::

vagrant@ubuntu2004:~$ source ~/venv3.10/bin/activate
vagrant@ubuntu2004:~$ PG_VERSION=13 make unittest
vagrant@ubuntu2004:~$ PG_VERSION=14 make unittest
vagrant@ubuntu2004:~$ deactivate

And so on
Expand Down
6 changes: 3 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ Vagrant.configure("2") do |config|
sed -i "s/^#start_conf.*/start_conf='manual'/g" /etc/postgresql-common/createcluster.conf
sed -i "s/^#create_main_cluster.*/create_main_cluster=false/g" /etc/postgresql-common/createcluster.conf
apt-get install -y python{3.8,3.9,3.10} python{3.8,3.9,3.10}-dev python{3.8,3.9,3.10}-venv
apt-get install -y postgresql-{11,12,13,14,15,16} postgresql-server-dev-{11,12,13,14,15,16}
apt-get install -y python{3.8,3.9,3.10,3.11,3.12} python{3.8,3.9,3.10,3.11,3.12}-dev python{3.8,3.9,3.10,3.11,3.12}-venv
apt-get install -y postgresql-{11,12,13,14,15,16} postgresql-server-dev-{12,13,14,15,16}
username="$(< /dev/urandom tr -dc a-z | head -c${1:-32};echo;)"
password=$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;)
Expand Down Expand Up @@ -68,7 +68,7 @@ Vagrant.configure("2") do |config|
config.vm.provision "shell", inline: $script, privileged: true

$script = <<-SCRIPT
versions=(3.8 3.9 3.10)
versions=(3.8 3.9 3.10 3.11 3.12)
for version in "${versions[@]}"; do
python${version} -m venv venv${version}
source ~/venv${version}/bin/activate
Expand Down
16 changes: 8 additions & 8 deletions docs/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,35 +54,35 @@ Vagrant
=======

The Vagrantfile can be used to setup a vagrant development environment. The vagrant environment has
python 3.8, 3.9 and 3.10 virtual environments and installations of postgresql 10, 11 and 12, 13 and 14.
python 3.8, 3.9, 3.10, 3.11 and 3.12 virtual environments and installations of postgresql 12, 13, 14, 15 and 16.

By default vagrant up will start a Virtualbox environment. The Vagrantfile will also work for libvirt, just prefix
``VAGRANT_DEFAULT_PROVIDER=libvirt`` to the ``vagrant up`` command.

Any combination of Python (3.8, 3.9 and 3.10) and Postgresql (10, 11, 12, 13 and 14)
Any combination of Python (3.8, 3.9, 3.10, 3.11 and 3.12) and Postgresql (12, 13, 14, 15 and 16)

Bring up vagrant instance and connect via ssh::

vagrant up
vagrant ssh
vagrant@ubuntu2004:~$ cd /vagrant

Test with Python 3.8 and Postgresql 11::
Test with Python 3.8 and Postgresql 12::

vagrant@ubuntu2004:~$ source ~/venv3.8/bin/activate
vagrant@ubuntu2004:~$ PG_VERSION=11 make unittest
vagrant@ubuntu2004:~$ PG_VERSION=12 make unittest
vagrant@ubuntu2004:~$ deactivate

Test with Python 3.9 and Postgresql 12::
Test with Python 3.9 and Postgresql 13::

vagrant@ubuntu2004:~$ source ~/venv3.9/bin/activate
vagrant@ubuntu2004:~$ PG_VERSION=12 make unittest
vagrant@ubuntu2004:~$ PG_VERSION=13 make unittest
vagrant@ubuntu2004:~$ deactivate

Test with Python 3.10 and Postgresql 13::
Test with Python 3.10 and Postgresql 14::

vagrant@ubuntu2004:~$ source ~/venv3.10/bin/activate
vagrant@ubuntu2004:~$ PG_VERSION=13 make unittest
vagrant@ubuntu2004:~$ PG_VERSION=14 make unittest
vagrant@ubuntu2004:~$ deactivate

And so on
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ classifiers=[
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Database :: Database Engines/Servers",
"Topic :: Software Development :: Libraries",
]
Expand Down
2 changes: 1 addition & 1 deletion test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

logutil.configure_logging()

DEFAULT_PG_VERSIONS = ["16", "15", "14", "13", "12", "11", "10"]
DEFAULT_PG_VERSIONS = ["16", "15", "14", "13", "12"]


def port_is_listening(hostname: str, port: int, timeout: float = 0.5) -> bool:
Expand Down

0 comments on commit a34cd3c

Please sign in to comment.