mirror of
https://github.com/datafolklabs/cement.git
synced 2026-02-06 11:16:46 +00:00
use pyproject.toml
This commit is contained in:
parent
ef4fa5b3d9
commit
a682491da8
14
.github/workflows/pdm.yml
vendored
Normal file
14
.github/workflows/pdm.yml
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
name: Update dependencies
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "5 3 * * 1"
|
||||
|
||||
jobs:
|
||||
update-dependencies:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
- name: Update dependencies
|
||||
uses: pdm-project/update-deps-action@main
|
||||
29
.github/workflows/pythonpublish.yml
vendored
Normal file
29
.github/workflows/pythonpublish.yml
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
name: Upload Python Package
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
permissions:
|
||||
id-token: write # trusted publishing
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.x'
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install build
|
||||
- name: Build package
|
||||
run: python -m build
|
||||
- name: Publish a Python distribution to PyPI
|
||||
uses: pypa/gh-action-pypi-publish@release/v1
|
||||
8
.gitignore
vendored
8
.gitignore
vendored
@ -77,4 +77,10 @@ dump.rdb
|
||||
.pytest_cache
|
||||
|
||||
# VS Code
|
||||
.vscode/
|
||||
.vscode/
|
||||
|
||||
# PDM
|
||||
.venv
|
||||
__pypackages__
|
||||
.pdm.toml
|
||||
.pdm-python
|
||||
|
||||
@ -3,7 +3,7 @@ LABEL MAINTAINER="BJ Dierkes <derks@datafolklabs.com>"
|
||||
ENV PS1="\[\e[0;33m\]|> cement <| \[\e[1;35m\]\W\[\e[0m\] \[\e[0m\]# "
|
||||
WORKDIR /src
|
||||
COPY . /src
|
||||
RUN python setup.py install \
|
||||
RUN pip install . \
|
||||
&& rm -rf /src
|
||||
WORKDIR /
|
||||
ENTRYPOINT ["/usr/local/bin/cement"]
|
||||
|
||||
24
Makefile
24
Makefile
@ -7,38 +7,32 @@ dev:
|
||||
docker-compose exec cement /bin/bash
|
||||
|
||||
test: comply
|
||||
python -m pytest -v --cov=cement --cov-report=term --cov-report=html:coverage-report --capture=sys tests/
|
||||
pdm run pytest --cov=cement tests
|
||||
|
||||
test-core: comply
|
||||
python -m pytest -v --cov=cement.core --cov-report=term --cov-report=html:coverage-report --capture=sys tests/core
|
||||
pdm run pytest --cov=cement.core tests/core
|
||||
|
||||
virtualenv:
|
||||
pdm venv create
|
||||
pdm install
|
||||
virtualenv --prompt '|> cement <| ' env
|
||||
env/bin/pip install -r requirements-dev.txt
|
||||
env/bin/python setup.py develop
|
||||
@echo
|
||||
@echo "VirtualENV Setup Complete. Now run: source env/bin/activate"
|
||||
@echo
|
||||
|
||||
virtualenv-windows:
|
||||
virtualenv --prompt '|> cement <| ' env-windows
|
||||
env-windows\\Scripts\\pip.exe install -r requirements-dev-windows.txt
|
||||
env-windows\\Scripts\\python.exe setup.py develop
|
||||
@echo
|
||||
@echo "VirtualENV Setup Complete. Now run: .\env-windows\Scripts\activate.ps1"
|
||||
@echo "VirtualENV Setup Complete. Now run: eval $(pdm venv activate)"
|
||||
@echo
|
||||
|
||||
comply:
|
||||
flake8 cement/ tests/
|
||||
pdm run ruff check cement/ tests/
|
||||
|
||||
comply-fix:
|
||||
autopep8 -ri cement/ tests/
|
||||
pdm run ruff check --fix cement/ tests/
|
||||
|
||||
comply-typing:
|
||||
mypy ./cement
|
||||
pdm run mypy
|
||||
|
||||
docs:
|
||||
python setup.py build_sphinx
|
||||
cd docs; pdm run sphinx-build ./source ./build; cd ..
|
||||
@echo
|
||||
@echo DOC: "file://"$$(echo `pwd`/docs/build/html/index.html)
|
||||
@echo
|
||||
|
||||
@ -3,9 +3,8 @@ LABEL MAINTAINER="BJ Dierkes <derks@datafolklabs.com>"
|
||||
ENV PS1="\[\e[0;33m\]|> cement-py312 <| \[\e[1;35m\]\W\[\e[0m\] \[\e[0m\]# "
|
||||
|
||||
WORKDIR /src
|
||||
COPY requirements-dev.txt /src/
|
||||
RUN apk update \
|
||||
&& apk add libmemcached-dev \
|
||||
RUN apk update --no-check-certificate \
|
||||
&& apk add --no-check-certificate libmemcached-dev \
|
||||
gcc \
|
||||
musl-dev \
|
||||
cyrus-sasl-dev \
|
||||
@ -18,10 +17,12 @@ RUN apk update \
|
||||
libffi-dev \
|
||||
openssl-dev \
|
||||
jq \
|
||||
&& ln -sf /usr/bin/vim /usr/bin/vi \
|
||||
&& pip install --no-cache-dir -r requirements-dev.txt \
|
||||
&& pip install --upgrade -r requirements-dev.txt
|
||||
pipx \
|
||||
&& ln -sf /usr/bin/vim /usr/bin/vi
|
||||
RUN pipx install pdm
|
||||
ENV PATH="${PATH}:/root/.local/bin"
|
||||
COPY . /src
|
||||
COPY docker/vimrc /root/.vimrc
|
||||
RUN python setup.py develop
|
||||
RUN pdm venv create
|
||||
RUN pdm install
|
||||
CMD ["/bin/bash"]
|
||||
|
||||
@ -3,9 +3,8 @@ LABEL MAINTAINER="BJ Dierkes <derks@datafolklabs.com>"
|
||||
ENV PS1="\[\e[0;33m\]|> cement-py311 <| \[\e[1;35m\]\W\[\e[0m\] \[\e[0m\]# "
|
||||
|
||||
WORKDIR /src
|
||||
COPY requirements-dev.txt /src/
|
||||
RUN apk update \
|
||||
&& apk add libmemcached-dev \
|
||||
RUN apk update --no-check-certificate \
|
||||
&& apk add --no-check-certificate libmemcached-dev \
|
||||
gcc \
|
||||
musl-dev \
|
||||
cyrus-sasl-dev \
|
||||
@ -18,10 +17,12 @@ RUN apk update \
|
||||
libffi-dev \
|
||||
openssl-dev \
|
||||
jq \
|
||||
&& ln -sf /usr/bin/vim /usr/bin/vi \
|
||||
&& pip install --no-cache-dir -r requirements-dev.txt \
|
||||
&& pip install --upgrade -r requirements-dev.txt
|
||||
pipx \
|
||||
&& ln -sf /usr/bin/vim /usr/bin/vi
|
||||
RUN pipx install pdm
|
||||
ENV PATH="${PATH}:/root/.local/bin"
|
||||
COPY . /src
|
||||
COPY docker/vimrc /root/.vimrc
|
||||
RUN python setup.py develop
|
||||
RUN pdm venv create
|
||||
RUN pdm install
|
||||
CMD ["/bin/bash"]
|
||||
|
||||
139
pyproject.toml
Normal file
139
pyproject.toml
Normal file
@ -0,0 +1,139 @@
|
||||
[project]
|
||||
name = "cement"
|
||||
description = "Application Framework for Python"
|
||||
readme = "README.md"
|
||||
keywords = [
|
||||
"python",
|
||||
"module",
|
||||
"cli framework"
|
||||
]
|
||||
authors=[{name = "Data Folk Labs, LLC", email= "derks@datafolklabs.com"}]
|
||||
license={file="LICENSE"}
|
||||
classifiers = [
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
]
|
||||
|
||||
dynamic = ["version"]
|
||||
|
||||
requires-python = ">=3.8"
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
alarm = []
|
||||
argparse = []
|
||||
colorlog = ["colorlog"]
|
||||
configparser = []
|
||||
daemon = []
|
||||
docs = ["sphinx", "sphinx_rtd_theme", "guzzle_sphinx_theme", "sphinxcontrib-napoleon"]
|
||||
dummy = []
|
||||
generate = ["pyYaml"]
|
||||
jinja2 = ["jinja2"]
|
||||
json = []
|
||||
logging = []
|
||||
memcached = ["pylibmc"]
|
||||
mustache = ["pystache"]
|
||||
plugin = []
|
||||
print = []
|
||||
redis = ["redis"]
|
||||
scrub = []
|
||||
smtp = []
|
||||
tabulate = ["tabulate"]
|
||||
watchdog = ["watchdog"]
|
||||
yaml = ["pyYaml"]
|
||||
|
||||
dynamic = ["version", "readme"]
|
||||
|
||||
[project.scripts]
|
||||
cement = "cement.cli.main:main"
|
||||
|
||||
[project.urls]
|
||||
homepage = "https://builtoncement.com"
|
||||
documentation = "https://docs.builtoncement.com"
|
||||
repository = "https://github.com/datafolklabs/cement"
|
||||
|
||||
[build-system]
|
||||
requires = ["pdm-backend"]
|
||||
build-backend = "pdm.backend"
|
||||
|
||||
###############
|
||||
# DEVELOPMENT #
|
||||
###############
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
addopts = "-v --cov-report=term --cov-report=html:coverage-report --capture=sys tests/"
|
||||
python_files= "test_*.py"
|
||||
|
||||
[tool.coverage.report]
|
||||
precision = 2
|
||||
|
||||
|
||||
[tool.pdm.build]
|
||||
package-dir = "cement"
|
||||
includes = ["cement/cli/templates/generate/*"]
|
||||
excludes = ["tests"]
|
||||
|
||||
[tool.pdm.version]
|
||||
source = "scm"
|
||||
|
||||
[tool.pdm.dev-dependencies]
|
||||
dev = [
|
||||
"pytest>=4.3.1",
|
||||
"pytest-cov>=2.6.1",
|
||||
"coverage>=4.5.3",
|
||||
"mypy>=1.9.0",
|
||||
"ruff>=0.3.2",
|
||||
]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 100
|
||||
exclude = [
|
||||
".git",
|
||||
"cement/cli/templates",
|
||||
"cement/cli/contrib"
|
||||
]
|
||||
|
||||
[tool.ruff.lint]
|
||||
extend-select = [
|
||||
"F", # pyflakes
|
||||
"E", "W", # pycodestyle
|
||||
# "N", # pep8-naming - enable later, some variables are not lowercase
|
||||
]
|
||||
ignore = [
|
||||
"E402",
|
||||
"E713",
|
||||
"E721",
|
||||
"E714",
|
||||
"F841",
|
||||
"F507"
|
||||
]
|
||||
|
||||
# TBD
|
||||
# [tool.ruff.format]
|
||||
# quote-style = "single"
|
||||
|
||||
[tool.mypy]
|
||||
files = [
|
||||
"cement/",
|
||||
# "tests/"
|
||||
]
|
||||
exclude = """(?x)(
|
||||
^cement/cli/templates |
|
||||
^cement/cli/contrib |
|
||||
^.git/ |
|
||||
^tests
|
||||
)"""
|
||||
|
||||
# https://mypy.readthedocs.io/en/stable/config_file.html#untyped-definitions-and-calls
|
||||
disallow_untyped_calls = true
|
||||
disallow_untyped_defs = true
|
||||
disallow_incomplete_defs = true
|
||||
check_untyped_defs = true
|
||||
disallow_untyped_decorators = true
|
||||
|
||||
# https://mypy.readthedocs.io/en/stable/config_file.html#none-and-optional-handling
|
||||
no_implicit_optional = true
|
||||
strict_optional = true
|
||||
@ -1,28 +0,0 @@
|
||||
# The following are only required for Cement development
|
||||
pytest>=4.3.1
|
||||
pytest-cov>=2.6.1
|
||||
coverage>=4.5.3
|
||||
sphinx
|
||||
sphinx_rtd_theme
|
||||
pep8
|
||||
autopep8
|
||||
pycodestyle
|
||||
flake8
|
||||
guzzle_sphinx_theme
|
||||
sphinxcontrib-napoleon
|
||||
mock
|
||||
twine>=1.11.0
|
||||
setuptools>=38.6.0
|
||||
wheel>=0.31.0
|
||||
|
||||
# Required for optional extensions
|
||||
pystache
|
||||
pyYaml
|
||||
redis
|
||||
colorlog
|
||||
tabulate
|
||||
jinja2
|
||||
watchdog
|
||||
|
||||
# unknown/broken/untested
|
||||
# pylibmc
|
||||
@ -1,31 +0,0 @@
|
||||
# The following are only required for Cement development
|
||||
pytest>=4.3.1
|
||||
pytest-cov>=2.6.1
|
||||
coverage>=4.5.3
|
||||
sphinx
|
||||
sphinx_rtd_theme
|
||||
pep8
|
||||
autopep8
|
||||
pycodestyle
|
||||
flake8
|
||||
pyflakes>=1.4.0
|
||||
guzzle_sphinx_theme
|
||||
sphinxcontrib-napoleon
|
||||
mock
|
||||
twine>=1.11.0
|
||||
setuptools>=38.6.0
|
||||
wheel>=0.31.0
|
||||
mypy
|
||||
|
||||
# Required for optional extensions
|
||||
pystache
|
||||
pyYaml
|
||||
redis
|
||||
colorlog
|
||||
tabulate
|
||||
jinja2
|
||||
watchdog
|
||||
pylibmc
|
||||
|
||||
# Required on Travis?
|
||||
async-timeout
|
||||
@ -1,3 +0,0 @@
|
||||
# Cement core does not have any external dependencies, however optional
|
||||
# extension might. It is up to the application developer to manage
|
||||
# requirements for optional extensions/dependencies.
|
||||
@ -11,5 +11,6 @@ docker-compose up -d mailpit 2>&1 >/dev/null
|
||||
sleep 10
|
||||
|
||||
rm -f .coverage
|
||||
pip install -r requirements-dev.txt
|
||||
pdm venv create
|
||||
pdm install
|
||||
make test
|
||||
|
||||
29
setup.cfg
29
setup.cfg
@ -1,29 +0,0 @@
|
||||
[build_sphinx]
|
||||
source-dir = docs/source
|
||||
build-dir = docs/build
|
||||
all_files = 1
|
||||
|
||||
[tool:pytest]
|
||||
python_files=test_*.py
|
||||
|
||||
[flake8]
|
||||
exclude = .git,cement/cli/templates,cement/cli/contrib
|
||||
|
||||
[mypy]
|
||||
exclude = (?x)(
|
||||
^cement/cli/templates |
|
||||
^cement/cli/contrib |
|
||||
^.git/ |
|
||||
^tests
|
||||
)
|
||||
|
||||
; https://mypy.readthedocs.io/en/stable/config_file.html#untyped-definitions-and-calls
|
||||
disallow_untyped_calls = True
|
||||
disallow_untyped_defs = True
|
||||
disallow_incomplete_defs = True
|
||||
check_untyped_defs = True
|
||||
disallow_untyped_decorators = True
|
||||
|
||||
; https://mypy.readthedocs.io/en/stable/config_file.html#none-and-optional-handling
|
||||
no_implicit_optional = True
|
||||
strict_optional = True
|
||||
61
setup.py
61
setup.py
@ -1,61 +0,0 @@
|
||||
|
||||
import sys
|
||||
from setuptools import setup, find_packages
|
||||
from cement.utils import version
|
||||
|
||||
VERSION = version.get_version()
|
||||
|
||||
f = open('README.md', 'r')
|
||||
LONG = f.read()
|
||||
f.close()
|
||||
|
||||
setup(name='cement',
|
||||
version=VERSION,
|
||||
python_requires='>=3.8',
|
||||
description='Application Framework for Python',
|
||||
long_description=LONG,
|
||||
long_description_content_type='text/markdown',
|
||||
classifiers=[],
|
||||
install_requires=[],
|
||||
keywords='cli framework',
|
||||
author='Data Folk Labs, LLC',
|
||||
author_email='derks@datafolklabs.com',
|
||||
url='https://builtoncement.com',
|
||||
project_urls={
|
||||
'Documentation': 'https://docs.builtoncement.com',
|
||||
'Source': 'https://github.com/datafolklabs/cement',
|
||||
},
|
||||
license='BSD',
|
||||
packages=find_packages(exclude=['ez_setup', 'tests*']),
|
||||
package_data={'cement': ['cement/cli/templates/generate/*']},
|
||||
include_package_data=True,
|
||||
zip_safe=False,
|
||||
test_suite='nose.collector',
|
||||
entry_points = {
|
||||
'console_scripts' : [
|
||||
'cement = cement.cli.main:main',
|
||||
],
|
||||
},
|
||||
extras_require = {
|
||||
'alarm': [],
|
||||
'argparse': [],
|
||||
'colorlog': ['colorlog'],
|
||||
'configparser': [],
|
||||
'daemon': [],
|
||||
'dummy': [],
|
||||
'generate': ['pyYaml'],
|
||||
'jinja2': ['jinja2'],
|
||||
'json': [],
|
||||
'logging': [],
|
||||
'memcached': ['pylibmc'],
|
||||
'mustache': ['pystache'],
|
||||
'plugin': [],
|
||||
'print': [],
|
||||
'redis': ['redis'],
|
||||
'scrub': [],
|
||||
'smtp': [],
|
||||
'tabulate': ['tabulate'],
|
||||
'watchdog': ['watchdog'],
|
||||
'yaml': ['pyYaml'],
|
||||
}
|
||||
)
|
||||
Loading…
Reference in New Issue
Block a user