Skip to content
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

Switch to setup.cfg from setup.py. #129

Merged
merged 3 commits into from
Oct 28, 2021
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
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ that offers more fully-featured integration.
Installation
------------
- Included as standard in the deb packages and docker images from matrix.org.
- If you installed into a virtualenv: `pip install matrix-synapse-ldap3`.
- If you installed into a virtualenv:
- Ensure pip is up-to-date: `pip install -U pip`.
- Install the LDAP password provider: `pip install matrix-synapse-ldap3`.
- For other installation mechanisms, see the documentation provided by the maintainer.

Usage
Expand Down
6 changes: 4 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ You will need push access to this repo as well as an account on PyPi with push
access to the
[matrix-synapse-ldap3](https://pypi.org/project/matrix-synapse-ldap3/) package.

You will need to install the `build` and `twine` packages.

1. Edit the `__version__` variable of `ldap_auth_provider.py` to the new release
version. This repository uses [Semantic Versioning](https://semver.org/).

Expand Down Expand Up @@ -35,8 +37,8 @@ version. This repository uses [Semantic Versioning](https://semver.org/).

1. Build and upload to PyPI:
```sh
python setup.py sdist
twine upload dist/matrix-synapse-ldap3-$ver.tar.gz
python -m build
twine upload dist/matrix-synapse-ldap3-$ver.tar.gz dist/matrix_synapse_ldap3-$ver-py3-none-any.whl
```

1. Create release on GH project page:
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools>=39.2.0", "wheel"]
build-backend = "setuptools.build_meta"
18 changes: 18 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
[metadata]
name = matrix-synapse-ldap3
url = https://github.com/matrix-org/matrix-synapse-ldap3
version = attr: ldap_auth_provider.__version__
description = An LDAP3 auth provider for Synapse
long_description = file: README.rst
Comment on lines +4 to +6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really liking attr: and file: rather than our (nice, but not really belonging in a config file) exec_file and read_file.

(I also believe I read somewhere that setuptools doesn't actually execute the code, it reads it from the AST.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is the main improvement IMO.

classifiers=
Development Status :: 4 - Beta
License :: OSI Approved :: Apache Software License
Programming Language :: Python :: 3 :: Only

[options]
install_requires =
Twisted>=15.1.0
ldap3>=2.8
service_identity
py_modules = ldap_auth_provider

[flake8]
max-line-length = 90
# W503 requires that binary operators be at the end, not start, of lines. Erik doesn't like it.
Expand Down
62 changes: 0 additions & 62 deletions setup.py

This file was deleted.

1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[tox]
envlist = packaging, pep8, py35, py36, py37, py38
isolated_build = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For onlookers who didn't know what this meant (me!):

Activate isolated build environment. tox will use a virtual environment to build a source distribution from the source tree. For build tools and arguments use the pyproject.toml file as specified in PEP-517 and PEP-518. To specify the virtual environment Python version define use the isolated_build_env config section.

tox


[testenv]
deps =
Expand Down