From 547bf0988ef81edb25fd0783b8d635108f614626 Mon Sep 17 00:00:00 2001 From: anoadragon453 Date: Tue, 3 May 2022 10:52:17 +0000 Subject: deploy: 7e6598bcf6cf63b4d04c27b9696ed8429b6ddff6 --- latest/development/cas.html | 2 +- latest/development/contributing_guide.html | 44 +++++++++++----------- latest/development/database_schema.html | 2 +- latest/development/demo.html | 2 +- latest/development/experimental_features.html | 2 +- latest/development/git.html | 2 +- .../development/internal_documentation/index.html | 2 +- latest/development/releases.html | 2 +- latest/development/room-dag-concepts.html | 2 +- latest/development/saml.html | 2 +- latest/development/url_previews.html | 2 +- 11 files changed, 32 insertions(+), 32 deletions(-) (limited to 'latest/development') diff --git a/latest/development/cas.html b/latest/development/cas.html index df3e34dbd2..086a352996 100644 --- a/latest/development/cas.html +++ b/latest/development/cas.html @@ -76,7 +76,7 @@ diff --git a/latest/development/contributing_guide.html b/latest/development/contributing_guide.html index 920ad727fd..bdcfd36ba8 100644 --- a/latest/development/contributing_guide.html +++ b/latest/development/contributing_guide.html @@ -76,7 +76,7 @@ @@ -177,16 +177,21 @@ git checkout develop

If you need help getting started with git, this is beyond the scope of the document, but you can find many good git tutorials on the web.

4. Install the dependencies

-

Once you have installed Python 3 and added the source, please open a terminal and -setup a virtualenv, as follows:

+

Synapse uses the poetry project to manage its dependencies +and development environment. Once you have installed Python 3 and added the +source, you should install poetry. +Of their installation methods, we recommend +installing poetry using pipx,

+
pip install --user pipx
+pipx install poetry
+
+

but see poetry's installation instructions +for other installation methods.

+

Next, open a terminal and install dependencies as follows:

cd path/where/you/have/cloned/the/repository
-python3 -m venv ./env
-source ./env/bin/activate
-pip install wheel
-pip install -e ".[all,dev]"
-pip install tox
+poetry install --extras all
 
-

This will install the developer dependencies for the project.

+

This will install the runtime and developer dependencies for the project.

5. Get in touch.

Join our developer community on Matrix: #synapse-dev:matrix.org!

6. Pick an issue.

@@ -226,37 +231,32 @@ want to test your code.

  • ensure that your code follows the coding style adopted by the project;
  • catch a number of errors in your code.
  • -

    The linter takes no time at all to run as soon as you've downloaded the dependencies into your python virtual environment.

    -
    source ./env/bin/activate
    -./scripts-dev/lint.sh
    +

    The linter takes no time at all to run as soon as you've downloaded the dependencies.

    +
    poetry run ./scripts-dev/lint.sh
     

    Note that this script will modify your files to fix styling errors. Make sure that you have saved all your files.

    If you wish to restrict the linters to only the files changed since the last commit (much faster!), you can instead run:

    -
    source ./env/bin/activate
    -./scripts-dev/lint.sh -d
    +
    poetry run ./scripts-dev/lint.sh -d
     

    Or if you know exactly which files you wish to lint, you can instead run:

    -
    source ./env/bin/activate
    -./scripts-dev/lint.sh path/to/file1.py path/to/file2.py path/to/folder
    +
    poetry run ./scripts-dev/lint.sh path/to/file1.py path/to/file2.py path/to/folder
     

    Run the unit tests (Twisted trial).

    The unit tests run parts of Synapse, including your changes, to see if anything was broken. They are slower than the linters but will typically catch more errors.

    -
    source ./env/bin/activate
    -trial tests
    +
    poetry run trial tests
     

    If you wish to only run some unit tests, you may specify another module instead of tests - or a test class or a method:

    -
    source ./env/bin/activate
    -trial tests.rest.admin.test_room tests.handlers.test_admin.ExfiltrateData.test_invite
    +
    poetry run trial tests.rest.admin.test_room tests.handlers.test_admin.ExfiltrateData.test_invite
     

    If your tests fail, you may wish to look at the logs (the default log level is ERROR):

    less _trial_temp/test.log
     

    To increase the log level for the tests, set SYNAPSE_TEST_LOG_LEVEL:

    -
    SYNAPSE_TEST_LOG_LEVEL=DEBUG trial tests
    +
    SYNAPSE_TEST_LOG_LEVEL=DEBUG poetry run trial tests
     

    By default, tests will use an in-memory SQLite database for test data. For additional help with debugging, one can use an on-disk SQLite database file instead, in order to @@ -264,7 +264,7 @@ review database state during and after running tests. This can be done by settin the SYNAPSE_TEST_PERSIST_SQLITE_DB environment variable. Doing so will cause the database state to be stored in a file named test.db under the trial process' working directory. Typically, this ends up being _trial_temp/test.db. For example:

    -
    SYNAPSE_TEST_PERSIST_SQLITE_DB=1 trial tests
    +
    SYNAPSE_TEST_PERSIST_SQLITE_DB=1 poetry run trial tests
     

    The database file can then be inspected with:

    sqlite3 _trial_temp/test.db
    diff --git a/latest/development/database_schema.html b/latest/development/database_schema.html
    index eb4678413a..d2e647f7c7 100644
    --- a/latest/development/database_schema.html
    +++ b/latest/development/database_schema.html
    @@ -76,7 +76,7 @@
     
             
    diff --git a/latest/development/demo.html b/latest/development/demo.html
    index 9e1b6ae22e..36cae37ec9 100644
    --- a/latest/development/demo.html
    +++ b/latest/development/demo.html
    @@ -76,7 +76,7 @@
     
             
    diff --git a/latest/development/experimental_features.html b/latest/development/experimental_features.html
    index 82a97bc900..d26901cf13 100644
    --- a/latest/development/experimental_features.html
    +++ b/latest/development/experimental_features.html
    @@ -76,7 +76,7 @@
     
             
    diff --git a/latest/development/git.html b/latest/development/git.html
    index bf4c865f1d..7207b899dc 100644
    --- a/latest/development/git.html
    +++ b/latest/development/git.html
    @@ -76,7 +76,7 @@
     
             
    diff --git a/latest/development/internal_documentation/index.html b/latest/development/internal_documentation/index.html
    index 5becaa50a3..842dadd755 100644
    --- a/latest/development/internal_documentation/index.html
    +++ b/latest/development/internal_documentation/index.html
    @@ -76,7 +76,7 @@
     
             
    diff --git a/latest/development/releases.html b/latest/development/releases.html
    index 6dcd0fbade..0a46b2456d 100644
    --- a/latest/development/releases.html
    +++ b/latest/development/releases.html
    @@ -76,7 +76,7 @@
     
             
    diff --git a/latest/development/room-dag-concepts.html b/latest/development/room-dag-concepts.html
    index a03d34be03..e2918f7ab3 100644
    --- a/latest/development/room-dag-concepts.html
    +++ b/latest/development/room-dag-concepts.html
    @@ -76,7 +76,7 @@
     
             
    diff --git a/latest/development/saml.html b/latest/development/saml.html
    index 3990872c8f..4fc686f5ec 100644
    --- a/latest/development/saml.html
    +++ b/latest/development/saml.html
    @@ -76,7 +76,7 @@
     
             
    diff --git a/latest/development/url_previews.html b/latest/development/url_previews.html
    index a9769a0a49..42ad082399 100644
    --- a/latest/development/url_previews.html
    +++ b/latest/development/url_previews.html
    @@ -76,7 +76,7 @@
     
             
    -- 
    cgit 1.5.1