Skip to content

feat(onboarding): add uv to python framework onboarding #90137

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

Merged
merged 19 commits into from
Apr 25, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 0 additions & 5 deletions static/app/gettingStartedDocs/python/aiohttp.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ describe('aiohttp onboarding docs', function () {
expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();

// Renders install instructions
expect(
screen.getByText(textWithMarkupMatcher(/pip install --upgrade sentry-sdk/))
).toBeInTheDocument();
});

it('renders without tracing', function () {
Expand Down
37 changes: 7 additions & 30 deletions static/app/gettingStartedDocs/python/aiohttp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import ExternalLink from 'sentry/components/links/externalLink';
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
import {
type Docs,
DocsPageLocation,
type DocsParams,
type OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
Expand All @@ -16,12 +15,14 @@ import {
featureFlagOnboarding,
} from 'sentry/gettingStartedDocs/python/python';
import {t, tct} from 'sentry/locale';
import {getPythonProfilingOnboarding} from 'sentry/utils/gettingStartedDocs/python';
import {
getPythonAiocontextvarsConfig,
getPythonInstallConfig,
getPythonProfilingOnboarding,
} from 'sentry/utils/gettingStartedDocs/python';

type Params = DocsParams;

const getInstallSnippet = () => `pip install --upgrade sentry-sdk`;

const getSdkSetupSnippet = (params: Params) => `
from aiohttp import web

Expand Down Expand Up @@ -68,37 +69,13 @@ const onboarding: OnboardingConfig = {
link: <ExternalLink href="https://docs.aiohttp.org/en/stable/web.html" />,
}
),
install: (params: Params) => [
install: () => [
{
type: StepType.INSTALL,
description: tct('Install [code:sentry-sdk] from PyPI:', {
code: <code />,
}),
configurations: [
{
description:
params.docsLocation === DocsPageLocation.PROFILING_PAGE
? tct(
'You need a minimum version [code:2.24.1] of the [code:sentry-python] SDK for the profiling feature.',
{
code: <code />,
}
)
: undefined,
language: 'bash',
code: getInstallSnippet(),
},
{
description: tct(
"If you're on Python 3.6, you also need the [code:aiocontextvars] package:",
{
code: <code />,
}
),
language: 'bash',
code: 'pip install --upgrade aiocontextvars',
},
],
configurations: [...getPythonInstallConfig(), ...getPythonAiocontextvarsConfig()],
},
],
configure: (params: Params) => [
Expand Down
5 changes: 0 additions & 5 deletions static/app/gettingStartedDocs/python/asgi.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ describe('asgi onboarding docs', function () {
expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();

// Renders install instructions
expect(
screen.getByText(textWithMarkupMatcher(/pip install --upgrade sentry-sdk/))
).toBeInTheDocument();
});

it('renders without tracing', function () {
Expand Down
27 changes: 7 additions & 20 deletions static/app/gettingStartedDocs/python/asgi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import ExternalLink from 'sentry/components/links/externalLink';
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
import {
type Docs,
DocsPageLocation,
type DocsParams,
type OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
Expand All @@ -13,12 +12,13 @@ import {
crashReportOnboardingPython,
} from 'sentry/gettingStartedDocs/python/python';
import {t, tct} from 'sentry/locale';
import {getPythonProfilingOnboarding} from 'sentry/utils/gettingStartedDocs/python';
import {
getPythonInstallConfig,
getPythonProfilingOnboarding,
} from 'sentry/utils/gettingStartedDocs/python';

type Params = DocsParams;

const getInstallSnippet = () => `pip install --upgrade sentry-sdk`;

const getSdkSetupSnippet = (params: Params) => `
import sentry_sdk
from sentry_sdk.integrations.asgi import SentryAsgiMiddleware
Expand Down Expand Up @@ -92,29 +92,16 @@ const onboarding: OnboardingConfig = {
link: <ExternalLink href="https://asgi.readthedocs.io/en/latest/" />,
}
),
install: (params: Params) => [
install: () => [
{
type: StepType.INSTALL,
description: tct('Install [code:sentry-sdk] from PyPI:', {
code: <code />,
}),
configurations: [
{
description:
params.docsLocation === DocsPageLocation.PROFILING_PAGE
? tct(
'You need a minimum version [code:2.24.1] of the [code:sentry-python] SDK for the profiling feature.',
{
code: <code />,
}
)
: undefined,
language: 'bash',
code: getInstallSnippet(),
},
],
configurations: getPythonInstallConfig(),
},
],

configure: (params: Params) => [
{
type: StepType.CONFIGURE,
Expand Down
5 changes: 0 additions & 5 deletions static/app/gettingStartedDocs/python/awslambda.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ describe('awslambda onboarding docs', function () {
expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
expect(screen.getByRole('heading', {name: 'Timeout Warning'})).toBeInTheDocument();

// Renders install instructions
expect(
screen.getByText(textWithMarkupMatcher(/pip install --upgrade sentry-sdk/))
).toBeInTheDocument();
});

it('renders without tracing', function () {
Expand Down
30 changes: 8 additions & 22 deletions static/app/gettingStartedDocs/python/awslambda.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
} from 'sentry/components/onboarding/gettingStartedDoc/step';
import {
type Docs,
DocsPageLocation,
type DocsParams,
type OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
Expand All @@ -19,11 +18,10 @@ import {
} from 'sentry/gettingStartedDocs/python/python';
import {t, tct} from 'sentry/locale';
import {space} from 'sentry/styles/space';
import {getPythonInstallConfig} from 'sentry/utils/gettingStartedDocs/python';

type Params = DocsParams;

const getInstallSnippet = () => `pip install --upgrade sentry-sdk`;

const getSdkSetupSnippet = (params: Params) => `
import sentry_sdk
from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration
Expand Down Expand Up @@ -72,24 +70,12 @@ sentry_sdk.init(
],
)`;

const installStep = (params: Params): StepProps => ({
const installStep = (): StepProps => ({
type: StepType.INSTALL,
description: tct('Install our Python SDK using [code:pip]:', {code: <code />}),
configurations: [
{
description:
params.docsLocation === DocsPageLocation.PROFILING_PAGE
? tct(
'You need a minimum version [code:2.24.1] of the [code:sentry-python] SDK for the profiling feature.',
{
code: <code />,
}
)
: undefined,
language: 'bash',
code: getInstallSnippet(),
},
],
description: tct('Install [code:sentry-sdk] from PyPI with the [code:django] extra:', {
code: <code />,
}),
configurations: getPythonInstallConfig(),
});

const configureStep = (params: Params): StepProps => ({
Expand Down Expand Up @@ -129,7 +115,7 @@ const onboarding: OnboardingConfig = {
),
}
),
install: (params: Params) => [installStep(params)],
install: () => [installStep()],
configure: (params: Params) => [
configureStep(params),
{
Expand Down Expand Up @@ -175,7 +161,7 @@ const onboarding: OnboardingConfig = {
};

const profilingOnboarding: OnboardingConfig = {
install: (params: Params) => [installStep(params)],
install: () => [installStep()],
configure: (params: Params) => [configureStep(params)],
verify: () => [],
};
Expand Down
7 changes: 0 additions & 7 deletions static/app/gettingStartedDocs/python/bottle.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ describe('bottle onboarding docs', function () {
expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();

// Renders install instructions
expect(
screen.getByText(
textWithMarkupMatcher(/pip install --upgrade 'sentry-sdk\[bottle\]'/)
)
).toBeInTheDocument();
});

it('renders without tracing', function () {
Expand Down
26 changes: 6 additions & 20 deletions static/app/gettingStartedDocs/python/bottle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import ExternalLink from 'sentry/components/links/externalLink';
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
import {
type Docs,
DocsPageLocation,
type DocsParams,
type OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
Expand All @@ -16,12 +15,13 @@ import {
featureFlagOnboarding,
} from 'sentry/gettingStartedDocs/python/python';
import {t, tct} from 'sentry/locale';
import {getPythonProfilingOnboarding} from 'sentry/utils/gettingStartedDocs/python';
import {
getPythonInstallConfig,
getPythonProfilingOnboarding,
} from 'sentry/utils/gettingStartedDocs/python';

type Params = DocsParams;

const getInstallSnippet = () => `pip install --upgrade 'sentry-sdk[bottle]'`;

const getSdkSetupSnippet = (params: Params) => `
import sentry_sdk

Expand Down Expand Up @@ -63,7 +63,7 @@ const onboarding: OnboardingConfig = {
tct('The Bottle integration adds support for the [link:Bottle Web Framework].', {
link: <ExternalLink href="https://bottlepy.org/docs/dev/" />,
}),
install: (params: Params) => [
install: () => [
{
type: StepType.INSTALL,
description: tct(
Expand All @@ -72,21 +72,7 @@ const onboarding: OnboardingConfig = {
code: <code />,
}
),
configurations: [
{
description:
params.docsLocation === DocsPageLocation.PROFILING_PAGE
? tct(
'You need a minimum version [code:2.24.1] of the [code:sentry-python] SDK for the profiling feature.',
{
code: <code />,
}
)
: undefined,
language: 'bash',
code: getInstallSnippet(),
},
],
configurations: getPythonInstallConfig({packageName: "'sentry-sdk[bottle]'"}),
},
],
configure: (params: Params) => [
Expand Down
7 changes: 0 additions & 7 deletions static/app/gettingStartedDocs/python/celery.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@ describe('celery onboarding docs', function () {
expect(screen.getByRole('heading', {name: 'Standalone Setup'})).toBeInTheDocument();
expect(screen.getByRole('heading', {name: 'Setup With Django'})).toBeInTheDocument();
expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();

// Renders install instructions
expect(
screen.getByText(
textWithMarkupMatcher(/pip install --upgrade 'sentry-sdk\[celery\]'/)
)
).toBeInTheDocument();
});

it('renders without tracing', function () {
Expand Down
26 changes: 6 additions & 20 deletions static/app/gettingStartedDocs/python/celery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {OnboardingCodeSnippet} from 'sentry/components/onboarding/gettingStarted
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
import {
type Docs,
DocsPageLocation,
type DocsParams,
type OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
Expand All @@ -16,12 +15,13 @@ import {
} from 'sentry/gettingStartedDocs/python/python';
import {t, tct} from 'sentry/locale';
import {space} from 'sentry/styles/space';
import {getPythonProfilingOnboarding} from 'sentry/utils/gettingStartedDocs/python';
import {
getPythonInstallConfig,
getPythonProfilingOnboarding,
} from 'sentry/utils/gettingStartedDocs/python';

type Params = DocsParams;

const getInstallSnippet = () => `pip install --upgrade 'sentry-sdk[celery]'`;

const getSdkSetupSnippet = (params: Params) => `
import sentry_sdk

Expand Down Expand Up @@ -63,7 +63,7 @@ const onboarding: OnboardingConfig = {
tct('The celery integration adds support for the [link:Celery Task Queue System].', {
link: <ExternalLink href="https://docs.celeryq.dev/en/stable/" />,
}),
install: (params: Params) => [
install: () => [
{
type: StepType.INSTALL,
description: tct(
Expand All @@ -72,21 +72,7 @@ const onboarding: OnboardingConfig = {
code: <code />,
}
),
configurations: [
{
description:
params.docsLocation === DocsPageLocation.PROFILING_PAGE
? tct(
'You need a minimum version [code:2.24.1] of the [code:sentry-python] SDK for the profiling feature.',
{
code: <code />,
}
)
: undefined,
language: 'bash',
code: getInstallSnippet(),
},
],
configurations: getPythonInstallConfig({packageName: "'sentry-sdk[celery]'"}),
},
],
configure: (params: Params) => [
Expand Down
7 changes: 0 additions & 7 deletions static/app/gettingStartedDocs/python/chalice.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ describe('chalice onboarding docs', function () {
expect(screen.getByRole('heading', {name: 'Install'})).toBeInTheDocument();
expect(screen.getByRole('heading', {name: 'Configure SDK'})).toBeInTheDocument();
expect(screen.getByRole('heading', {name: 'Verify'})).toBeInTheDocument();

// Renders install instructions
expect(
screen.getByText(
textWithMarkupMatcher(/pip install --upgrade 'sentry-sdk\[chalice\]'/)
)
).toBeInTheDocument();
});

it('renders without tracing', function () {
Expand Down
Loading
Loading