Skip to content

chore: update hatch version and remove hatch-containers #10373

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 25 commits into from
Aug 27, 2024
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
8 changes: 6 additions & 2 deletions .circleci/config.templ.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ commands:
setup_hatch:
description: "Install hatch"
steps:
- run: pip3 install hatch~=1.8.0 hatch-containers==0.7.0
- run:
name: "Install hatch"
command: |
curl -L https://github.com/pypa/hatch/releases/download/hatch-v1.12.0/hatch-x86_64-unknown-linux-gnu.tar.gz | tar zx
sudo install -t /usr/local/bin hatch
hatch -q

start_docker_services:
description: "Start Docker services"
Expand Down Expand Up @@ -1345,7 +1350,6 @@ jobs:
# build documentation and store as an artifact
executor: ddtrace_dev
steps:
- setup_hatch
- checkout
- run:
command: |
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/generate-package-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Generate Package Versions
on:
workflow_dispatch: # can be triggered manually
schedule:
- cron: '0 0 * * 0' # weekly on Sunday at midnight

- cron: "0 0 * * 0" # weekly on Sunday at midnight

jobs:
generate-package-versions:
Expand Down Expand Up @@ -32,7 +31,7 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
Expand All @@ -54,18 +53,22 @@ jobs:

- name: Start docker service
run: docker-compose up -d testagent

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libmariadb-dev


- name: Install hatch
uses: pypa/hatch@install
with:
version: "1.12.0"

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install packaging
pip install riot==0.19.1
pip install hatch~=1.8.0 hatch-containers==0.7.0

- name: Run regenerate-riot-latest
run: scripts/regenerate-riot-latest.sh
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ jobs:
run: rustup update stable && rustup default stable && rustup component add rustfmt clippy

- name: Install hatch
run: pip install hatch
uses: pypa/hatch@install
with:
version: "1.12.0"

- name: Run tests
run: hatch run ddtrace_unit_tests:test
4 changes: 3 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ build:
python: "3.10"
commands:
- git fetch --unshallow || true
- pip install hatch~=1.8.0 hatch-containers==0.7.0
- curl -L https://github.com/pypa/hatch/releases/download/hatch-v1.12.0/hatch-x86_64-unknown-linux-gnu.tar.gz | tar zx
- install -t /usr/local/bin hatch
- hatch -q
- curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain stable -y
- echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> "$BASH_ENV"
- hatch -v run docs:sphinx-build -W -b html docs docs/_build/html
Expand Down
7 changes: 3 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
FROM debian:buster-20221219-slim

ARG TARGETARCH
ARG HATCH_VERSION=1.8.1
ARG HATCH_VERSION=1.12.0

# http://bugs.python.org/issue19846
# > At the moment, setting "LANG=C" on a Linux system *fundamentally breaks Python 3*, and that's not OK.
Expand Down Expand Up @@ -76,10 +76,9 @@ RUN git clone --depth 1 --branch v2.4.2 https://github.com/pyenv/pyenv "${PYENV_
&& cd -

RUN if [ "$TARGETARCH" = "amd64" ]; \
then curl -L https://github.com/pypa/hatch/releases/download/hatch-v${HATCH_VERSION}/hatch-${HATCH_VERSION}-x86_64-unknown-linux-gnu.tar.gz | tar zx; \
else curl -L https://github.com/pypa/hatch/releases/download/hatch-v${HATCH_VERSION}/hatch-${HATCH_VERSION}-aarch64-unknown-linux-gnu.tar.gz | tar zx; \
then curl -L https://github.com/pypa/hatch/releases/download/hatch-v${HATCH_VERSION}/hatch-x86_64-unknown-linux-gnu.tar.gz | tar zx; \
else curl -L https://github.com/pypa/hatch/releases/download/hatch-v${HATCH_VERSION}/hatch-aarch64-unknown-linux-gnu.tar.gz | tar zx; \
fi \
&& mv hatch-${HATCH_VERSION}-* hatch \
&& install -t /usr/local/bin hatch \
&& hatch -q

Expand Down
3 changes: 2 additions & 1 deletion docs/contributing-testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ In addition, you will need `riot <https://ddriot.readthedocs.io/en/latest/>`_ an
.. code-block:: bash

$ pip install riot==0.19.1
$ pip install hatch~=1.8.0 hatch-containers==0.7.0

Refer `hatch install <https://hatch.pypa.io/latest/install/>`_ for installation instructions

Some of our test environments are managed with Riot, others with Hatch.

Expand Down
9 changes: 0 additions & 9 deletions hatch.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
[env]
requires = [
"hatch-containers==0.7.0",
]

[envs.lint]
detached = true
python = "3.10"
Expand Down Expand Up @@ -114,10 +109,6 @@ build = [
"scripts/docs/build.sh",
]

[envs.docs.overrides]
# Local MacOS development requires Docker containers
platform.macos.type = { value = "container" }

[envs.slotscheck]
template = "slotscheck"
python = "3.10"
Expand Down
5 changes: 4 additions & 1 deletion scripts/ddtest
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ fi
# retry docker pull if fails
for i in {1..3}; do docker-compose pull -q testrunner && break || sleep 3; done

FULL_CMD="pip install -q --disable-pip-version-check riot==0.19.1 hatch && $CMD"
# DEV: Removing hatch==1.12.0 from this command results in weird failure
# in which building dd-trace-py fails as it can't find clang compiler for some
# venvs using Python 3.11.
FULL_CMD="pip install -q --disable-pip-version-check riot==0.19.1 hatch==1.12.0 && $CMD"


# install and upgrade riot in case testrunner image has not been updated
Expand Down
9 changes: 9 additions & 0 deletions scripts/docs/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/usr/bin/env bash
set -eux

# DEV: unless it's built with editable, following sphinx-build fails
if [ -z ${CIRCLECI+x} ]; then
CMAKE_BUILD_PARALLEL_LEVEL=$(nproc) pip install -v -e .
fi

if [[ "$(uname)" == "Darwin" ]]; then
export PYENCHANT_LIBRARY_PATH=/opt/homebrew/lib/libenchant-2.dylib
fi

reno lint
sphinx-build -vvv -W -b spelling docs docs/_build/html
sphinx-build -vvv -W -b html docs docs/_build/html
4 changes: 4 additions & 0 deletions scripts/docs/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ elif [[ "${READTHEDOCS}" = "True" ]]; then
# We skip here because we do not check spelling in RTD
echo "Skipping install"
else
if [[ "$(uname)" == "Darwin" ]]; then
brew install enchant
else
export DEBIAN_FRONTEND="noninteractive"
export DEBCONF_NOWARNINGS="yes"

apt-get -qq update
apt-get -qy install --no-install-recommends libenchant-2-dev >/dev/null ||
apt-get -qy install --no-install-recommends libenchant-dev >/dev/null
fi
fi
Loading