Skip to content

Commit

Permalink
Devops: Move package configuration entirely to pyproject.toml
Browse files Browse the repository at this point in the history
The `pyproject.toml` approach for package metadata is now the standard
approach in the community and widely supported. The `setup.cfg` is now
obsolete as well as the `setup.py` shim. The build backend is switched
to flit which is used by most other packages in the `aiidateam`
organization.
  • Loading branch information
sphuber committed May 30, 2024
1 parent 8f7610f commit a23742c
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 74 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Install python dependencies
run: |
pip install .[pre_commit,testing]
pip install .[dev]
pip freeze
- name: Run pre-commit
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:

- name: Install pgsu
run: |
pip install -e .[testing]
pip install -e .[dev]
pip freeze
- name: Run test suite
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:

- name: Install pgsu
run: |
pip install -e .[testing]
pip install -e .[dev]
pip freeze
- name: Run test suite
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:

- name: Install pgsu
run: |
pip install -e .[testing]
pip install -e .[dev]
pip freeze
- name: Run test suite
Expand Down Expand Up @@ -187,7 +187,7 @@ jobs:
#
# - name: Install pgsu
# run: |
# pip install -e .[testing]
# pip install -e .[dev]
# pip freeze
#
# # note: I tested this locally with *only* the homebrew postgres server running and it worked.
Expand Down Expand Up @@ -233,7 +233,7 @@ jobs:
- name: Install pgsu
run: |
pip install -e .[testing]
pip install -e .[dev]
pip freeze
- name: Run test suite
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ Executing query: SELECT usename FROM pg_user

Run the tests as follows:
```bash
pip install -e .[testing]
pip install -e .[dev]
pytest
```
5 changes: 2 additions & 3 deletions pgsu/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
"""Connect to an existing PostgreSQL cluster as the `postgres` superuser and execute SQL commands.
"""
"""Connect to an existing PostgreSQL cluster as the `postgres` superuser and execute SQL commands."""
__version__ = '0.2.4'

import logging
import traceback
Expand Down
66 changes: 64 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,68 @@
[build-system]
requires = ["setuptools>=46.4.0", "wheel"]
build-backend = "setuptools.build_meta"
build-backend = 'flit_core.buildapi'
requires = ['flit_core>=3.4,<4']

[project]
authors = [
{name = 'AiiDA Team', email = 'aiidateam@gmail.com'}
]
classifiers = [
'License :: OSI Approved :: MIT License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: Implementation :: CPython',
]
dependencies = [
'click',
'psycopg[binary]>=3.0'
]
dynamic = ['description', 'version']
keywords = ['aiida', 'workflows']
license = {file = 'LICENSE'}
name = 'pgsu'
readme = 'README.md'
requires-python = '>=3.7'

[project.optional-dependencies]
dev = [
'pre-commit~=2.2',
'pylint~=2.5.0',
'pgtest>=1.3.1',
'pytest',
'pytest-cov'
]

[project.scripts]
pgsu = 'pgsu.cli:run'

[project.urls]
homepage = 'https://github.com/aiidateam/pgsu'
source = 'https://github.com/aiidateam/pgsu'
tracker = 'https://github.com/aiidateam/pgsu/issues'

[tool.flit.module]
name = 'pgsu'

[tool.flit.sdist]
exclude = [
'.github/',
'tests/',
'.coverage',
'.gitignore',
'.pre-commit-config.yaml'
]

[tool.coverage.run]
parallel = true

[tool.pylint.format]
max-line-length = 120
Expand Down
52 changes: 0 additions & 52 deletions setup.cfg

This file was deleted.

7 changes: 0 additions & 7 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ usedevelop = true
[testenv:py{37,38,39}]
description = Run unit tests with this Python version
extras =
testing
dev
commands = pytest {posargs}

0 comments on commit a23742c

Please sign in to comment.