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

Add PIP/PyPI support with gitauto model #430

Closed

Conversation

gitauto-ai[bot]
Copy link
Contributor

@gitauto-ai gitauto-ai bot commented Jul 22, 2024

Original issue: #229

What is the feature

This feature adds support for publishing the project to PIP/PyPI, allowing users to easily install and manage the package using Python's package manager.

Why we need the feature

Publishing the project to PIP/PyPI will significantly increase its accessibility and ease of use for Python developers. It will allow users to install the package with a simple pip install command, manage dependencies more effectively, and integrate the package into their existing Python projects seamlessly.

How to implement and why

  1. Create setup.py:

    • This file is essential for packaging the project. It will include metadata about the project such as name, version, author, and dependencies.
    • Example:
      from setuptools import setup, find_packages
      
      setup(
          name='bancos_brasileiros',
          version='0.1.0',
          author='Author Name',
          author_email='[email protected]',
          description='A description of the project',
          long_description=open('README.md').read(),
          long_description_content_type='text/markdown',
          url='https://github.com/username/repo',
          packages=find_packages(),
          classifiers=[
              'Programming Language :: Python :: 3',
              'License :: OSI Approved :: MIT License',
              'Operating System :: OS Independent',
          ],
          python_requires='>=3.6',
      )
  2. Update README.md:

    • Add installation instructions using PIP.
    • Example:
      ## Installation
      
      You can install the package using pip:
      
      ```bash
      pip install bancos_brasileiros
      
      
  3. Create a .pypirc file:

    • This file will store your PyPI credentials for uploading the package.
    • Example:
      [distutils]
      index-servers =
          pypi
      
      [pypi]
      username = your-username
      password = your-password
  4. Build the package:

    • Use setuptools to build the package.
    • Command:
      python setup.py sdist bdist_wheel
  5. Upload the package to PyPI:

    • Use twine to upload the package.
    • Command:
      twine upload dist/*
  6. Automate the process:

    • Optionally, add a GitHub Action workflow to automate the build and upload process on new releases.
    • Example workflow (.github/workflows/publish.yml):
      name: Publish to PyPI
      
      on:
        release:
          types: [created]
      
      jobs:
        build:
          runs-on: ubuntu-latest
      
          steps:
          - uses: actions/checkout@v2
          - name: Set up Python
            uses: actions/setup-python@v2
            with:
              python-version: 3.x
          - name: Install dependencies
            run: pip install setuptools wheel twine
          - name: Build package
            run: python setup.py sdist bdist_wheel
          - name: Publish package
            env:
              TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
              TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
            run: twine upload dist/*

By following these steps, we can ensure that the project is properly packaged and published to PIP/PyPI, making it easily accessible to the Python community.

Test these changes locally

git checkout -b gitauto/issue-#229-146e322f-c041-4556-a1c9-bba0a7a08291
git pull origin gitauto/issue-#229-146e322f-c041-4556-a1c9-bba0a7a08291

…isort, PHP CS Fixer, RuboCop, Ruff Formatter, Rustfmt, StandardRB and swift-format

This commit fixes the style issues introduced in 6c75e92 according to the output
from ClangFormat, dotnet-format, Go fmt, Gofumpt, isort, PHP CS Fixer, RuboCop,
Ruff Formatter, Rustfmt, StandardRB and swift-format.

Details: #430
@github-actions github-actions bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 22, 2024
@gstraccini gstraccini bot requested a review from guibranco July 22, 2024 00:10
@gstraccini gstraccini bot added 🚦awaiting triage 🤖 bot Automated processes or integrations labels Jul 22, 2024
@guibranco guibranco changed the title Fix [FEATURE] Add PIP/PyPI support with gitauto model Add PIP/PyPI support with gitauto model Aug 15, 2024
@guibranco guibranco linked an issue Aug 16, 2024 that may be closed by this pull request
@gstraccini gstraccini bot added dependencies Pull requests that update a dependency file 📝 documentation Tasks related to writing or updating documentation enhancement A enhancement to the project :octocat: github-actions GitHub Actions for automation and CI/CD good first issue A issue for someone self assign and help me =D hacktoberfest Participation in the Hacktoberfest event help wanted Feel free to take this issue for you and help me! packages Publishing packages python Pyhton labels Aug 19, 2024
Copy link
Contributor

gstraccini bot commented Aug 19, 2024

This pull request is ready ✅ for merge/squash.

Repository owner deleted a comment from gstraccini bot Aug 21, 2024
Repository owner deleted a comment from gstraccini bot Aug 21, 2024
@gstraccini gstraccini bot added the gitauto GitAuto label to trigger the app in a issue. label Aug 22, 2024
Copy link
Contributor

gstraccini bot commented Aug 30, 2024

This pull request is ready ✅ for merge/squash.

@guibranco guibranco closed this Aug 30, 2024
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@guibranco guibranco deleted the gitauto/issue-#229-146e322f-c041-4556-a1c9-bba0a7a08291 branch September 13, 2024 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 bot Automated processes or integrations dependencies Pull requests that update a dependency file 📝 documentation Tasks related to writing or updating documentation enhancement A enhancement to the project gitauto GitAuto label to trigger the app in a issue. good first issue A issue for someone self assign and help me =D hacktoberfest Participation in the Hacktoberfest event help wanted Feel free to take this issue for you and help me! :octocat: github-actions GitHub Actions for automation and CI/CD packages Publishing packages python Pyhton size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add support to PIP/PyPI - Python
1 participant