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

openedx/ecommerce and openedx/ecommerce-worker Python 3.12 upgrade #78

Closed
4 tasks done
DawoudSheraz opened this issue Apr 17, 2024 · 7 comments
Closed
4 tasks done
Assignees

Comments

@DawoudSheraz
Copy link

DawoudSheraz commented Apr 17, 2024

As mentioned on https://discuss.openedx.org/t/these-idas-will-not-be-upgraded-to-python-3-11-by-redwood/12755, ecommerce and ecommerce-worker are not prioritized for Python 3.11/3.12 upgrades and are free for community to pick them up. Since these are important repositories and their upgrades are blocking tutor-ecommerce upgrade (#68), Edly can take a dig at upgrading them. A note that these upgrade will be backwards compatible with 3.8.

  • Ensure openedx/ecommerce codebase has CI checks against 3.11 and 3.12
  • Ensure openedx/ecommerce-worker codebase has CI checks against 3.11 and 3.12
  • Fix openedx/ecommerce CI build issues by performing code upgrades
  • Fix openedx/ecommerce-worker CI build issues by performing code upgrades

Upstream issues

@DawoudSheraz
Copy link
Author

@Danyal-Faheem Please add a status update for this issue. Thanks

@Danyal-Faheem
Copy link
Contributor

Danyal-Faheem commented May 21, 2024

Thank you for reminding me @DawoudSheraz.

The PR for ecommerce is still in progress as I am currently facing an issue after updating the MySQL client for compatibility with python 3.11 and 3.12. It seems like an issue with the pkg-config package which tox can't seem to locate. Also, for some reason, tox seems to be enforcing python3.8 even when the PYTHON_ENV and TOXENV is set to py311/py312 which seems to crash tox.

As for the ecommerce-worker PR, it is pending a review from the opened team as I have made the required changes.

@Prakash1210
Copy link

  1. Fork the Repositories

First, fork the openedx/ecommerce and openedx/ecommerce-worker repositories to your GitHub account:

Navigate to the [openedx/ecommerce] (https://github.com/openedx/ecommerce) repository and click the "Fork" button.
Navigate to the [openedx/ecommerce-worker] (https://github.com/openedx/ecommerce-worker) repository and click the "Fork" button.
2. Clone the Forked Repositories

Clone your forked repositories to your local machine:

git clone https://github.com/<your-username>/ecommerce.git
git clone https://github.com/<your-username>/ecommerce-worker.git
  1. Set Up Python Environments

Set up Python environments for both projects. You can use tools like pyenv and virtualenv to manage multiple Python versions.

# For ecommerce
cd ecommerce
pyenv install 3.11.0
pyenv install 3.12.0
pyenv local 3.11.0: Switch to Python 3.11
Python: -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt

# For ecommerce-worker
cd ../ecommerce-worker
pyenv local 3.11.0: Switch to Python 3.11
Python: -m venv venv
source venv/bin/activate
pip install -r requirements.txt
pip install -r requirements-dev.txt
  1. Update CI Configurations

Update the CI configurations to include Python 3.11 and 3.12. Typically, these configurations are in .github/workflows/ci.yml or similar files.

For example, in a GitHub Actions workflow:

# .github/workflows/ci.yml
jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.8, 3.11, 3.12]
    steps:
    uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v2
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt
        pip install -r requirements-dev.txt
    - name: Run tests
      run: |
        pytest  # Or the test command specific to the project
  1. Fix Compatibility Issues

Run the tests locally for Python 3.11 and 3.12 and fix any compatibility issues. This may involve updating dependencies, modifying code to be compatible with new Python versions, or fixing deprecations.

 For ecommerce
cd ecommerce
pyenv local 3.11.0
source venv/bin/activate
pytest

pyenv local 3.12.0
source venv/bin/activate
pytest

 For ecommerce-worker
cd ../ecommerce-worker
pyenv local 3.11.0
source venv/bin/activate
pytest

pyenv local 3.12.0
source venv/bin/activate
pytest
  1. Commit and Push Changes

After ensuring that all tests pass, commit and push your changes to your forked repositories:

 For ecommerce
cd ecommerce
git add .
git commit -m "Add CI support for Python 3.11 and 3.12"
git push origin main

 For ecommerce-worker
cd ../ecommerce-worker
git add .
git commit -m "Add CI support for Python 3.11 and 3.12"
git push origin main
  1. Create Pull Requests

Create pull requests to the original repositories:

  • Navigate to your fork of the openedx/ecommerce repository on GitHub and click the "New pull request" button. Provide a clear description of the changes and link to any relevant issues (e.g., openedx/ecommerce#4161).
  • Navigate to your fork of the openedx/ecommerce-worker repository on GitHub and do the same. Reference the relevant issue (e.g., openedx/ecommerce-worker#262).

8. Monitor and Respond to Feedback

Monitor the pull requests for any feedback from the repository maintainers and respond promptly. You may need to make additional changes based on their comments.

Summary

  1. Fork and clone the repositories.
  2. Set up Python environments for Python 3.11 and 3.12.
  3. Update CI configurations to include Python 3.11 and 3.12.
  4. Fix any compatibility issues and run tests locally.
  5. Commit and push the changes.
  6. Create pull requests.
  7. Monitor and respond to feedback.

By following these steps, you should be able to contribute to the upgrade of openedx/ecommerce and openedx/ecommerce-worker to support Python 3.11 and 3.12.

@DawoudSheraz
Copy link
Author

The above seems like an AI-generated comment, it is a very generic to-do list.

@DawoudSheraz
Copy link
Author

@Faraz32123 Please add the updates on the issue, including the PRs. Thank you.

@Faraz32123
Copy link
Collaborator

PR for ecommerce-Worker is already merged and its Issue is closed.

For ecommerce, it's PR is up for review. Already asked some folks for a review. Once it's reviewed & merged, it's issue will also be closed.

@Faraz32123
Copy link
Collaborator

Closing this issue as the upstream Issues are closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

4 participants