Skip to content

Commit

Permalink
Merge pull request tahoe-lafs#1395 from meejah/4133.packaging-disaste…
Browse files Browse the repository at this point in the history
…r-zone

4133: use declarative build via pyproject.toml and hatch
  • Loading branch information
meejah authored Dec 10, 2024
2 parents e24b9ec + 85335f1 commit dc6ea19
Show file tree
Hide file tree
Showing 15 changed files with 321 additions and 563 deletions.
65 changes: 6 additions & 59 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ dockerhub-auth-template: &DOCKERHUB_AUTH
<<: *DOCKERHUB_CONTEXT
- "build-image-fedora-35":
<<: *DOCKERHUB_CONTEXT
- "build-image-oraclelinux-8":
<<: *DOCKERHUB_CONTEXT
# Restore later as PyPy38
#- "build-image-pypy27-buster":
# <<: *DOCKERHUB_CONTEXT
Expand Down Expand Up @@ -88,12 +86,8 @@ workflows:
- "ubuntu-22-04":
{}

# Equivalent to RHEL 8; CentOS 8 is dead.
- "oraclelinux-8":
{}

- "nixos":
name: "<<matrix.pythonVersion>>"
name: "nixos-<<matrix.pythonVersion>>"
nixpkgs: "nixpkgs-unstable"
matrix:
parameters:
Expand Down Expand Up @@ -229,7 +223,7 @@ jobs:
# version-specific binary packages so include the Python version
# in this key, as well as the canonical source of our
# dependencies.
- &CACHE_KEY "pip-packages-v1-<< parameters.pythonVersion >>-{{ checksum \"setup.py\" }}"
- &CACHE_KEY "pip-packages-v1-<< parameters.pythonVersion >>-{{ checksum \"pyproject.toml\" }}"

- "run":
name: "Fix $env:PATH"
Expand Down Expand Up @@ -257,9 +251,6 @@ jobs:
# doesn't cost us anything extra and saves us effort next time.
name: "(Maybe) Build Wheels"
command: |
python -m pip install setuptools # Some Pythons for Windows do not come with setuptools
python setup.py update_version # Cheat to win a race about writing _version.py
if ((Test-Path .\wheelhouse) -and (Test-Path .\wheelhouse\*)) {
echo "Found populated wheelhouse, skipping wheel building."
} else {
Expand All @@ -278,7 +269,7 @@ jobs:
name: "Install Dependencies"
environment:
# By this point we should no longer need an index.
PIP_NO_INDEX: "1"
## PIP_NO_INDEX: "1"
command: |
python -m pip install .[testenv] .[test]
Expand Down Expand Up @@ -543,37 +534,6 @@ jobs:
<<: *UTF_8_ENVIRONMENT
TAHOE_LAFS_TOX_ENVIRONMENT: "py310"

oraclelinux-8: &RHEL_DERIV
docker:
- <<: *DOCKERHUB_AUTH
image: "tahoelafsci/oraclelinux:8-py3.8"
user: "nobody"

environment:
<<: *UTF_8_ENVIRONMENT
TAHOE_LAFS_TOX_ENVIRONMENT: "py38"

# pip cannot install packages if the working directory is not readable.
# We want to run a lot of steps as nobody instead of as root.
working_directory: "/tmp/project"

steps:
- "checkout"
- run: *SETUP_VIRTUALENV
- run: *RUN_TESTS
- store_test_results: *STORE_TEST_RESULTS
- store_artifacts: *STORE_TEST_LOG
- store_artifacts: *STORE_ELIOT_LOG
- store_artifacts: *STORE_OTHER_ARTIFACTS
- run: *SUBMIT_COVERAGE

fedora-35:
<<: *RHEL_DERIV
docker:
- <<: *DOCKERHUB_AUTH
image: "tahoelafsci/fedora:35-py3"
user: "nobody"

nixos:
parameters:
nixpkgs:
Expand Down Expand Up @@ -701,14 +661,6 @@ jobs:
PYTHON_VERSION: "3.10"


build-image-oraclelinux-8:
<<: *BUILD_IMAGE

environment:
DISTRO: "oraclelinux"
TAG: "8"
PYTHON_VERSION: "3.8"

build-image-fedora-35:
<<: *BUILD_IMAGE

Expand Down Expand Up @@ -743,6 +695,9 @@ executors:
- <<: *DOCKERHUB_AUTH
image: "nixos/nix:2.16.1"
environment:
# currently, all NixOS builds are broken; ignore them
ALLOWED_FAILURE: "yes"

# CACHIX_AUTH_TOKEN is manually set in the CircleCI web UI and allows us
# to push to CACHIX_NAME. CACHIX_NAME tells cachix which cache to push
# to.
Expand Down Expand Up @@ -787,14 +742,6 @@ commands:
- "checkout"

- "run":
# The Nix package doesn't know how to do this part, unfortunately.
name: "Generate version"
command: |
nix-shell \
-p 'python3.withPackages (ps: [ ps.setuptools ])' \
--run 'python setup.py update_version'
- "run":
name: "Build Package"
command: |
Expand Down
2 changes: 1 addition & 1 deletion .circleci/create-virtualenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ virtualenv --python "${PYTHON}" "${BOOTSTRAP_VENV}"
PIP="${BOOTSTRAP_VENV}/bin/pip"

# Tell pip where it can find any existing wheels.
export PIP_FIND_LINKS="file://${WHEELHOUSE_PATH}"
##export PIP_FIND_LINKS="file://${WHEELHOUSE_PATH}"

# Get "certifi" to avoid bug #2913. Basically if a `setup_requires=...` causes
# a package to be installed (with setuptools) then it'll fail on certain
Expand Down
3 changes: 2 additions & 1 deletion .circleci/populate-wheelhouse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ LANG="en_US.UTF-8" "${PIP}" \
wheel \
--wheel-dir "${WHEELHOUSE_PATH}" \
"${PROJECT_ROOT}"[testenv] \
"${PROJECT_ROOT}"[test]
"${PROJECT_ROOT}"[test] \
"${PROJECT_ROOT}"[build]
2 changes: 1 addition & 1 deletion .circleci/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ TIMEOUT="timeout --kill-after 1m 45m"
# via tox and then scraping it out is hideous and failure prone.
export SUBUNITREPORTER_OUTPUT_PATH="${SUBUNIT2}"
export TAHOE_LAFS_TRIAL_ARGS="${TAHOE_LAFS_TRIAL_ARGS:---reporter=subunitv2-file --rterrors}"
export PIP_NO_INDEX="1"
##export PIP_NO_INDEX="1"

# Make output unbuffered, so progress reports from subunitv2-file get streamed
# and notify CircleCI we're still alive.
Expand Down
4 changes: 2 additions & 2 deletions .circleci/setup-virtualenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ TAHOE_LAFS_TOX_ARGS=$1
shift || :

# Tell pip where it can find any existing wheels.
export PIP_FIND_LINKS="file://${WHEELHOUSE_PATH}"
export PIP_NO_INDEX="1"
##export PIP_FIND_LINKS="file://${WHEELHOUSE_PATH}"
##export PIP_NO_INDEX="1"

# Get everything else installed in it, too.
"${BOOTSTRAP_VENV}"/bin/tox \
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:

- name: Install Python packages
run: |
pip install --upgrade tox tox-gh-actions setuptools
pip install --upgrade tox tox-gh-actions
pip list
- name: Display tool versions
Expand All @@ -95,13 +95,13 @@ jobs:
- name: Upload eliot.log
uses: actions/upload-artifact@v4
with:
name: "eliot-${{ matrix.os }}-Python-${{ matrix.python-version }}.log"
name: "eliot-${{ matrix.os }}-python-${{ matrix.python-version }}.log"
path: eliot.log

- name: Upload trial log
uses: actions/upload-artifact@v4
with:
name: "test-${{ matrix.os }}-Python-${{ matrix.python-version }}.log"
name: "test-${{ matrix.os }}-python-${{ matrix.python-version }}.log"
path: _trial_temp/test.log

# Upload this job's coverage data to Coveralls. While there is a GitHub
Expand Down Expand Up @@ -233,7 +233,7 @@ jobs:
uses: actions/upload-artifact@v4
if: failure()
with:
name: "integration.eliot-${{ matrix.os }}-Python-${{ matrix.python-version }}.json"
name: "integration.eliot-${{ matrix.os }}-python-${{ matrix.python-version }}.json"
path: integration.eliot.json

packaging:
Expand Down
13 changes: 0 additions & 13 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Once ``tahoe --version`` works, see `How to Run Tahoe-LAFS <docs/running.rst>`__
🐍 Python 2
-----------

Python 3.8 or later is required.
Python 3.9 or later is required.
If you are still using Python 2.7, use Tahoe-LAFS version 1.17.1.


Expand Down
2 changes: 1 addition & 1 deletion integration/test_tor.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,6 @@ def test_anonymous_client(reactor, request, temp_dir, flog_gatherer, tor_network
yield util.await_client_ready(normie)

anonymoose = yield _create_anonymous_node(reactor, 'anonymoose', 8102, request, temp_dir, flog_gatherer, tor_network, introducer_furl, 1)
yield util.await_client_ready(anonymoose, minimum_number_of_servers=1, timeout=600)
yield util.await_client_ready(anonymoose, minimum_number_of_servers=1, timeout=1200)

yield upload_to_one_download_from_the_other(reactor, temp_dir, normie, anonymoose)
1 change: 1 addition & 0 deletions newsfragments/4133.installation
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Now using the "hatch" build system, and pyproject.toml (exclusively)
Loading

0 comments on commit dc6ea19

Please sign in to comment.