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

feature: add support to python 3.13 #366

Merged
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source codes
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Check License
Expand All @@ -54,7 +54,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source codes
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Check plugin doc
Expand All @@ -73,7 +73,7 @@ jobs:
outputs:
agent: ${{ steps.filter.outputs.agent }}
steps:
- uses: actions/checkout@v3 # required for push event
- uses: actions/checkout@v4 # required for push event
- name: Check for file changes
uses: getsentry/paths-filter@v2.11.1
id: filter
Expand Down Expand Up @@ -107,7 +107,7 @@ jobs:
((github.event_name == 'schedule' && github.repository == 'apache/skywalking-python') || needs.changes.outputs.agent == 'true')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- id: set-matrix
run: |
sudo apt-get install jq
Expand All @@ -131,15 +131,15 @@ jobs:
BASE_PYTHON_IMAGE: ${{ matrix.python-version }}
steps:
- name: Checkout source codes
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Build SkyWalking Python agent base plugin image
run: |
docker build --build-arg BASE_PYTHON_IMAGE -t apache/skywalking-python-agent:latest-plugin --no-cache . -f tests/plugin/Dockerfile.plugin
docker save -o docker-images-skywalking-python-plugin-${{ matrix.python-version }}.tar apache/skywalking-python-agent:latest-plugin
- name: Upload docker image with specific python version
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docker-images-skywalking-python-plugin-${{ matrix.python-version }}
path: docker-images-skywalking-python-plugin-${{ matrix.python-version }}.tar
Expand All @@ -164,7 +164,7 @@ jobs:
BASE_PYTHON_IMAGE: ${{ matrix.python-version }}
steps:
- name: Checkout source codes
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Install docker-compose
Expand All @@ -177,15 +177,15 @@ jobs:
sudo chmod +x /usr/local/bin/docker-compose
fi
- name: Pull SkyWalking Python agent base image
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: docker-images-skywalking-python-plugin-${{ matrix.python-version }}-slim
path: docker-images
- name: Load docker images
run: find docker-images -name "*.tar" -exec docker load -i {} \;
- name: Set up Python ${{ matrix.python-version }}
# This step is crucial for correct plugin matrix in test orchestration
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Run unit tests
Expand All @@ -210,15 +210,15 @@ jobs:
BASE_PYTHON_IMAGE: ${{ matrix.python-image-variant }}
steps:
- name: Checkout source codes
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Build SkyWalking Python agent base e2e image
run: |
docker build --build-arg BASE_PYTHON_IMAGE -t apache/skywalking-python-agent:latest-e2e --no-cache . -f tests/e2e/base/Dockerfile.e2e
docker save -o docker-images-skywalking-python-e2e-${{ matrix.python-image-variant }}.tar apache/skywalking-python-agent:latest-e2e
- name: Upload docker image
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docker-images-skywalking-python-e2e-${{ matrix.python-image-variant }}
path: docker-images-skywalking-python-e2e-${{ matrix.python-image-variant }}.tar
Expand Down Expand Up @@ -262,11 +262,11 @@ jobs:
fail-fast: false
steps:
- name: Checkout source codes
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Pull SkyWalking Python agent base image
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: docker-images-skywalking-python-e2e-${{ matrix.python-image-variant }}
path: docker-images
Expand All @@ -278,7 +278,7 @@ jobs:
log-dir: /tmp/e2e-logs
e2e-file: ${{ matrix.case.path }}
- name: Upload Logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: e2e_logs_${{ matrix.case.name }}_${{ matrix.python-image-variant }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dead-link-checker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
timeout-minutes: 30
if: (github.event_name == 'schedule' && github.repository == 'apache/skywalking-python') || (github.event_name != 'schedule')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-quiet-mode: 'no'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
packages: write
timeout-minutes: 120
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true
- name: Set environment variables
Expand All @@ -54,14 +54,14 @@ jobs:
echo "VERSION=${{ github.sha }}" >> $GITHUB_ENV
fi
- name: Log in to the Container registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v3
- name: Build and push docker image
run: make push-image -j 5
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
- Feature:
- Drop support for 3.7 (#356)
- Support sampling rate setup. Provide `SW_SAMPLE_N_PER_3_SECS` environment variable to control it (#357)
- Add suport for 3.13 (#366)

- Plugins:
- Add gRPC plugin (#362)
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ gen-basic:
.PHONY: install
install: gen-basic
python3 -m pip install --upgrade pip
python3 -m pip install .[all]
python3 -m pip install -e .[all]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Thinking about this parameter, maybe is not necesssary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It adds support for editable mode, its a suggestion to improve development experience. But it's not a problem to remove it 👍


.PHONY: lint
# flake8 configurations should go to the file setup.cfg
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ sw-python = 'skywalking.bootstrap.cli.sw_python:start'


[tool.poetry.dependencies]
python = ">=3.8, <3.12"
python = ">=3.8, <=3.13"
grpcio = '*'
grpcio-tools = '*'
packaging = '*'
Expand Down
5 changes: 4 additions & 1 deletion skywalking/plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,10 @@ def install():
logger.info("plugin %s is disabled and thus won't be installed", modname)
continue
logger.debug('installing plugin %s', modname)
plugin = importer.find_module(modname).load_module(modname)
if sys.version_info < (3, 12):
plugin = importer.find_module(modname).load_module(modname)
else:
plugin = importlib.util.module_from_spec(importer.find_spec(modname))

# todo: refactor the version checker, currently it doesn't really work as intended
supported = pkg_version_check(plugin)
Expand Down
Loading