@@ -120,7 +120,7 @@ redis = ["txredisapi>=1.4.7", "hiredis"]
120120# Required to use experimental `caches.track_memory_usage` config option.
121121cache-memory = [" pympler" ]
122122# If this is updated, don't forget to update the equivalent lines in
123- # tool.poetry.group. dev.dependencies .
123+ # `dependency-groups. dev` below .
124124test = [" parameterized>=0.9.0" , " idna>=3.3" ]
125125
126126# The duplication here is awful.
@@ -177,6 +177,85 @@ synapse_port_db = "synapse._scripts.synapse_port_db:main"
177177synapse_review_recent_signups = " synapse._scripts.review_recent_signups:main"
178178update_synapse_database = " synapse._scripts.update_synapse_database:main"
179179
180+ [tool .poetry ]
181+ packages = [{ include = " synapse" }]
182+
183+ [tool .poetry .build ]
184+ # Compile our rust module when using `poetry install`. This is still required
185+ # while using `poetry` as the build frontend. Saves the developer from needing
186+ # to run both:
187+ #
188+ # $ poetry install
189+ # $ maturin develop
190+ script = " build_rust.py"
191+ # Create a `setup.py` file which will call the `build` method in our build
192+ # script.
193+ #
194+ # Our build script currently uses the "old" build method, where we define a
195+ # `build` method and `setup.py` calls it. Poetry developers have mentioned that
196+ # this will eventually be removed:
197+ # https://github.com/matrix-org/synapse/pull/14949#issuecomment-1418001859
198+ #
199+ # The new build method is defined here:
200+ # https://python-poetry.org/docs/building-extension-modules/#maturin-build-script
201+ # but is still marked as "unstable" at the time of writing. This would also
202+ # bump our minimum `poetry-core` version to 1.5.0.
203+ #
204+ # We can just drop this work-around entirely if migrating away from
205+ # Poetry, thus there's little motivation to update the build script.
206+ generate-setup-file = true
207+
208+ # Dependencies used for developing Synapse itself.
209+ #
210+ # Hold off on migrating these to `dev-dependencies` (PEP 735) for now until
211+ # Poetry 2.2.0+, pip 25.1+ are more widely available.
212+ [tool .poetry .group .dev .dependencies ]
213+ # We pin development dependencies in poetry.lock so that our tests don't start
214+ # failing on new releases. Keeping lower bounds loose here means that dependabot
215+ # can bump versions without having to update the content-hash in the lockfile.
216+ # This helps prevents merge conflicts when running a batch of dependabot updates.
217+ ruff = " 0.14.6"
218+
219+ # Typechecking
220+ lxml-stubs = " >=0.4.0"
221+ mypy = " *"
222+ mypy-zope = " *"
223+ types-bleach = " >=4.1.0"
224+ types-jsonschema = " >=3.2.0"
225+ types-netaddr = " >=0.8.0.6"
226+ types-opentracing = " >=2.4.2"
227+ types-Pillow = " >=8.3.4"
228+ types-psycopg2 = " >=2.9.9"
229+ types-pyOpenSSL = " >=20.0.7"
230+ types-PyYAML = " >=5.4.10"
231+ types-requests = " >=2.26.0"
232+ types-setuptools = " >=57.4.0"
233+
234+ # Dependencies which are exclusively required by unit test code. This is
235+ # NOT a list of all modules that are necessary to run the unit tests.
236+ # Tests assume that all optional dependencies are installed.
237+ #
238+ # If this is updated, don't forget to update the equivalent lines in
239+ # project.optional-dependencies.test.
240+ parameterized = " >=0.9.0"
241+ idna = " >=3.3"
242+
243+ # The following are used by the release script
244+ click = " >=8.1.3"
245+ # GitPython was == 3.1.14; bumped to 3.1.20, the first release with type hints.
246+ GitPython = " >=3.1.20"
247+ markdown-it-py = " >=3.0.0"
248+ pygithub = " >=1.59"
249+ # The following are executed as commands by the release script.
250+ twine = " *"
251+ # Towncrier min version comes from https://github.com/matrix-org/synapse/pull/3425. Rationale unclear.
252+ towncrier = " >=18.6.0rc1"
253+
254+ # Used for checking the Poetry lockfile
255+ tomli = " >=1.2.3"
256+
257+ # Used for checking the schema delta files
258+ sqlglot = " >=28.0.0"
180259
181260[tool .towncrier ]
182261 package = " synapse"
@@ -291,88 +370,29 @@ line-ending = "auto"
291370[tool .maturin ]
292371manifest-path = " rust/Cargo.toml"
293372module-name = " synapse.synapse_rust"
294-
295- [tool .poetry ]
296- packages = [
297- { include = " synapse" },
298- ]
299- include = [
300- { path = " AUTHORS.rst" , format = " sdist" },
301- { path = " book.toml" , format = " sdist" },
302- { path = " changelog.d" , format = " sdist" },
303- { path = " CHANGES.md" , format = " sdist" },
304- { path = " CONTRIBUTING.md" , format = " sdist" },
305- { path = " demo" , format = " sdist" },
306- { path = " docs" , format = " sdist" },
307- { path = " INSTALL.md" , format = " sdist" },
308- { path = " mypy.ini" , format = " sdist" },
309- { path = " scripts-dev" , format = " sdist" },
310- { path = " synmark" , format =" sdist" },
311- { path = " sytest-blacklist" , format = " sdist" },
312- { path = " tests" , format = " sdist" },
313- { path = " UPGRADE.rst" , format = " sdist" },
314- { path = " Cargo.toml" , format = " sdist" },
315- { path = " Cargo.lock" , format = " sdist" },
316- { path = " rust/Cargo.toml" , format = " sdist" },
317- { path = " rust/build.rs" , format = " sdist" },
318- { path = " rust/src/**" , format = " sdist" },
373+ python-source = " ."
374+ sdist-include = [
375+ " AUTHORS.rst" ,
376+ " book.toml" ,
377+ " changelog.d" ,
378+ " CHANGES.md" ,
379+ " CONTRIBUTING.md" ,
380+ " demo" ,
381+ " docs" ,
382+ " INSTALL.md" ,
383+ " mypy.ini" ,
384+ " scripts-dev" ,
385+ " synmark" ,
386+ " sytest-blacklist" ,
387+ " tests" ,
388+ " UPGRADE.rst" ,
389+ " Cargo.toml" ,
390+ " Cargo.lock" ,
391+ " rust/Cargo.toml" ,
392+ " rust/build.rs" ,
393+ " rust/src/**" ,
319394]
320- exclude = [
321- { path = " synapse/*.so" , format = " sdist" }
322- ]
323-
324- [tool .poetry .build ]
325- script = " build_rust.py"
326- generate-setup-file = true
327-
328- [tool .poetry .group .dev .dependencies ]
329- # We pin development dependencies in poetry.lock so that our tests don't start
330- # failing on new releases. Keeping lower bounds loose here means that dependabot
331- # can bump versions without having to update the content-hash in the lockfile.
332- # This helps prevents merge conflicts when running a batch of dependabot updates.
333- ruff = " 0.14.6"
334-
335- # Typechecking
336- lxml-stubs = " >=0.4.0"
337- mypy = " *"
338- mypy-zope = " *"
339- types-bleach = " >=4.1.0"
340- types-jsonschema = " >=3.2.0"
341- types-netaddr = " >=0.8.0.6"
342- types-opentracing = " >=2.4.2"
343- types-Pillow = " >=8.3.4"
344- types-psycopg2 = " >=2.9.9"
345- types-pyOpenSSL = " >=20.0.7"
346- types-PyYAML = " >=5.4.10"
347- types-requests = " >=2.26.0"
348- types-setuptools = " >=57.4.0"
349-
350- # Dependencies which are exclusively required by unit test code. This is
351- # NOT a list of all modules that are necessary to run the unit tests.
352- # Tests assume that all optional dependencies are installed.
353- #
354- # If this is updated, don't forget to update the equivalent lines in
355- # project.optional-dependencies.test.
356- parameterized = " >=0.9.0"
357- idna = " >=3.3"
358-
359- # The following are used by the release script
360- click = " >=8.1.3"
361- # GitPython was == 3.1.14; bumped to 3.1.20, the first release with type hints.
362- GitPython = " >=3.1.20"
363- markdown-it-py = " >=3.0.0"
364- pygithub = " >=1.59"
365- # The following are executed as commands by the release script.
366- twine = " *"
367- # Towncrier min version comes from https://github.com/matrix-org/synapse/pull/3425. Rationale unclear.
368- towncrier = " >=18.6.0rc1"
369-
370- # Used for checking the Poetry lockfile
371- tomli = " >=1.2.3"
372-
373- # Used for checking the schema delta files
374- sqlglot = " >=28.0.0"
375-
395+ sdist-exclude = [" synapse/*.so" ]
376396
377397[build-system ]
378398# The upper bounds here are defensive, intended to prevent situations like
@@ -381,8 +401,8 @@ sqlglot = ">=28.0.0"
381401# runtime errors caused by build system changes.
382402# We are happy to raise these upper bounds upon request,
383403# provided we check that it's safe to do so (i.e. that CI passes).
384- requires = [" poetry-core>=2.0.0,<=2.1.3 " , " setuptools_rust>=1.3,<=1.11.1 " ]
385- build-backend = " poetry.core.masonry.api "
404+ requires = [" maturin>=1.0,<2.0 " ]
405+ build-backend = " maturin "
386406
387407
388408[tool .cibuildwheel ]
@@ -419,8 +439,3 @@ environment= { PATH = "$PATH:$HOME/.cargo/bin" }
419439before-build = " rm -rf {project}/build"
420440build-frontend = " build"
421441test-command = " python -c 'from synapse.synapse_rust import sum_as_string; print(sum_as_string(1, 2))'"
422-
423-
424- [tool .cibuildwheel .linux ]
425- # Wrap the repair command to correctly rename the built cpython wheels as ABI3.
426- repair-wheel-command = " ./.ci/scripts/auditwheel_wrapper.py -w {dest_dir} {wheel}"
0 commit comments