Closed DawoudSheraz closed 3 months ago
@Danyal-Faheem Please add a status update for this issue. Thanks
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.
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.
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
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
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
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
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
Create pull requests to the original repositories:
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).openedx/ecommerce-worker
repository on GitHub and do the same. Reference the relevant issue (e.g., openedx/ecommerce-worker#262).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
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.
The above seems like an AI-generated comment, it is a very generic to-do list.
@Faraz32123 Please add the updates on the issue, including the PRs. Thank you.
Closing this issue as the upstream Issues are closed.
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 (https://github.com/overhangio/tutor-ecommerce/issues/68), Edly can take a dig at upgrading them. A note that these upgrade will be backwards compatible with 3.8.
Upstream issues