Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a Python Package for Nevron Framework #91

Open
1 task done
gromdimon opened this issue Jan 19, 2025 · 0 comments
Open
1 task done

Create a Python Package for Nevron Framework #91

gromdimon opened this issue Jan 19, 2025 · 0 comments
Assignees
Labels
feature New feature or request
Milestone

Comments

@gromdimon
Copy link
Contributor

Issue Search

  • I have searched the existing feature requests

Problem Statement

Is your feature request related to a problem? Please describe.

Currently, the Nevron framework is accessible only by cloning the repository. To increase accessibility and allow seamless integration into other projects, it should be published as a Python package on PyPI. This will make it easier for users to install and use the framework with a simple pip install nevron command.


Describe the solution you'd like

The solution involves creating a Python package for Nevron, ensuring that it complies with Python packaging standards, and publishing it on PyPI.

Proposed Solution

Steps to Implement:

  1. Prepare the Project for Packaging:

    • Add a setup.py file.
    • Add a pyproject.toml file for modern Python packaging (PEP 517/518 compliance).
    • Ensure a proper directory structure for the package, such as:
      nevron/
          __init__.py
          core/
              ...
          memory/
              ...
          planning/
              ...
          ...
      
  2. Define Metadata in setup.py:
    Include necessary metadata such as:

    • Name: nevron
    • Version: Use semantic versioning (e.g., 0.1.0).
    • Description: A concise description of the framework.
    • Author and License: Provide author details and an open-source license (e.g., MIT).
    • Dependencies: List required dependencies in install_requires.
  3. Prepare a README.md for PyPI:

    • Write detailed documentation in Markdown format.
    • Include installation instructions, usage examples, and links to GitHub.
  4. Add a .pypirc Configuration File for Publishing:

    • Configure the .pypirc file with PyPI credentials (store safely in GitHub secrets).
  5. Automate the Build and Publish Process:

    • Use setuptools or poetry for building the package.
    • Add a GitHub Action workflow to:
      • Lint the code.
      • Run tests.
      • Build the package using python setup.py sdist bdist_wheel.
      • Publish the package to PyPI using twine.
  6. Test the Installation:

    • Install the package locally using pip install . and verify its functionality.
    • Test installation from PyPI on a separate virtual environment.

Describe alternatives you've considered

  • Distributing the framework via GitHub releases: This is less convenient for end users compared to PyPI.
  • Using a custom private PyPI server: This would restrict accessibility and reduce adoption.

Alternative Solutions

No response

Additional Context

Additional Context

  • Include a version of the setup.py template:

    from setuptools import setup, find_packages
    
    setup(
        name="nevron",
        version="0.1.0",
        description="A Python framework for building autonomous AI agents.",
        long_description=open("README.md").read(),
        long_description_content_type="text/markdown",
        author="Your Name",
        author_email="[email protected]",
        url="https://github.com/your_repo/nevron",
        packages=find_packages(),
        install_requires=[
            "loguru",
            "httpx",
            "tweepy",
            "openai",
            "anthropic",
            "qdrant-client",
            # Add other dependencies here
        ],
        classifiers=[
            "Programming Language :: Python :: 3",
            "License :: OSI Approved :: MIT License",
            "Operating System :: OS Independent",
        ],
        python_requires=">=3.7",
    )
  • Include a sample GitHub Actions workflow for publishing:

    name: Publish Python Package
    
    on:
      push:
        tags:
          - 'v*.*.*'
    
    jobs:
      publish:
        runs-on: ubuntu-latest
    
        steps:
          - name: Check out code
            uses: actions/checkout@v3
    
          - name: Set up Python
            uses: actions/setup-python@v4
            with:
              python-version: "3.9"
    
          - name: Install dependencies
            run: pip install setuptools wheel twine
    
          - name: Build package
            run: python setup.py sdist bdist_wheel
    
          - name: Publish to PyPI
            env:
              TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
              TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
            run: twine upload dist/*
@gromdimon gromdimon added the feature New feature or request label Jan 19, 2025
@gromdimon gromdimon added this to the v0.2.0 milestone Jan 19, 2025
@gromdimon gromdimon modified the milestones: v0.2.0, v0.3.0 Jan 19, 2025
@gromdimon gromdimon modified the milestones: v0.3.0, v0.5.0 Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants