Skip to main content

A reusable deployment framework for Python.

Project description

PyDaffodil

pydaffodil is a reusable deployment framework for Python, designed to simplify the process of deploying applications to remote VPS servers.

Features

  • Check for admin privileges
  • Run shell commands
  • Transfer files using SCP
  • Execute SSH commands
  • Modular and reusable deployment steps

Installation

pip install pydaffodil

Usage

from pydaffodil import Daffodil

cli = Daffodil(remote_user="root", remote_host="123.221.11.243", remote_path="/root/prod/bccs")

steps = [
    {"step": "Build the project", "command": lambda: cli.run_command("npm run build")},
    {"step": "Stop backend process on remote server", "command": lambda: cli.ssh_command("sudo forever stop 1")},
    {"step": "Transfer files to remote server", "command": lambda: cli.transfer_files("build")},
    {"step": "Restart backend process on remote server", "command": lambda: cli.ssh_command("sudo forever restartall")}
]

cli.deploy(steps)

How to Republish to PyPI

To republish this project to PyPI after making changes, follow these steps:

1. Update the Version Number

In order to upload a new version to PyPI, you must increment the version number in the setup.py file. For example, if the current version is 1.0.0, change it to 1.0.1:

# setup.py
setup(
    name="pydaffodil",
    version="1.0.1",  # Increment the version number here
    # Other metadata...
)

2. Build the Package

Run the following command to build both the source distribution (.tar.gz) and the wheel (.whl) files:

python -m build

This will generate the package files in the dist/ folder.

3. Upload the Package to PyPI

Once your package is built, you can use twine to upload it to PyPI. Run the following command to upload the new version:

twine upload dist/*

You'll be prompted to enter your PyPI credentials. Make sure to have them ready.

4. Test Your New Release

After uploading, you can verify that the new version has been successfully published by installing it using pip:

pip install --upgrade pydaffodil

This will install the latest version of the package.

5. Re-uploading to TestPyPI (Optional)

If you'd like to test the release before publishing it to the official PyPI, you can upload to TestPyPI instead:

twine upload --repository-url https://test.pypi.org/legacy/ dist/*

Then install it from TestPyPI to verify:

pip install --index-url https://test.pypi.org/simple/ pydaffodil

This ensures that everything is working correctly before pushing the package to the main PyPI repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydaffodil-1.0.8.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydaffodil-1.0.8-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file pydaffodil-1.0.8.tar.gz.

File metadata

  • Download URL: pydaffodil-1.0.8.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for pydaffodil-1.0.8.tar.gz
Algorithm Hash digest
SHA256 2d95f47e9172d9f7ecfdd4c680c77fc5d90bc07c2963becdec3195f8e7d16a63
MD5 9bfbd942e2ff08da5035d2516aa87465
BLAKE2b-256 6a5781e26883c1814573efbd0937eb9903115e5931995559f58f553fdd42593e

See more details on using hashes here.

File details

Details for the file pydaffodil-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: pydaffodil-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for pydaffodil-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 a122588789ca5353cdd796dd2f02ca03dc58079c5bb5be0e8aafcbfe2240ea93
MD5 98fac49f5e474c5a96bae740c5265058
BLAKE2b-256 07876c8d7434e11858fe3dfa15929d86063fb854f6d433ba5a8233a048533da3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page