Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Dump setuptools; correct pyproject version number (#12478)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson authored Apr 20, 2022
1 parent 103f51d commit e5a76ec
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 412 deletions.
4 changes: 0 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@
!pyproject.toml
!poetry.lock

# TODO: remove these once we have moved over to using poetry-core in pyproject.toml
!MANIFEST.in
!setup.py

**/__pycache__
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install -e .
- run: pip install .
- run: scripts-dev/generate_sample_config.sh --check
- run: scripts-dev/config-lint.sh

Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ _trial_temp*/
.DS_Store
__pycache__/

# We do want the poetry lockfile. TODO: is there a good reason for ignoring
# '*.lock' above? If not, let's nuke it.
# We do want the poetry lockfile.
!poetry.lock

# stuff that is likely to exist when you run a server locally
Expand Down
54 changes: 0 additions & 54 deletions MANIFEST.in

This file was deleted.

1 change: 1 addition & 0 deletions changelog.d/12337.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use poetry to manage Synapse's dependencies.
1 change: 1 addition & 0 deletions changelog.d/12478.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use poetry-core instead of setuptools to build wheels.
6 changes: 2 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
WORKDIR /synapse

# Copy just what we need to run `poetry export`...
COPY pyproject.toml poetry.lock README.rst /synapse/
COPY pyproject.toml poetry.lock /synapse/

RUN /root/.local/bin/poetry export --extras all -o /synapse/requirements.txt

Expand Down Expand Up @@ -98,9 +98,7 @@ RUN --mount=type=cache,target=/root/.cache/pip \
# Copy over the rest of the synapse source code.
COPY synapse /synapse/synapse/
# ... and what we need to `pip install`.
# TODO: once pyproject.toml declares poetry-core as its build system, we'll need to copy
# pyproject.toml here, ditching setup.py and MANIFEST.in.
COPY setup.py MANIFEST.in README.rst /synapse/
COPY pyproject.toml README.rst /synapse/

# Install the synapse package itself.
RUN pip install --prefix="/install" --no-deps --no-warn-script-location /synapse
Expand Down
1 change: 0 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ no_implicit_optional = True
files =
docker/,
scripts-dev/,
setup.py,
synapse/,
tests/

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -280,5 +280,5 @@ twine = "*"
towncrier = ">=18.6.0rc1"

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
9 changes: 0 additions & 9 deletions setup.cfg

This file was deleted.

183 changes: 0 additions & 183 deletions setup.py

This file was deleted.

4 changes: 3 additions & 1 deletion synapse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
import os
import sys

from matrix_common.versionstring import get_distribution_version_string

# Check that we're not running on an unsupported Python version.
if sys.version_info < (3, 7):
print("Synapse requires Python 3.7 or above.")
Expand Down Expand Up @@ -68,7 +70,7 @@
except ImportError:
pass

__version__ = "1.57.0"
__version__ = get_distribution_version_string("matrix-synapse")

if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)):
# We import here so that we don't have to install a bunch of deps when
Expand Down
Loading

0 comments on commit e5a76ec

Please sign in to comment.