Skip to content

Commit

Permalink
ADDED: pyproject.toml
Browse files Browse the repository at this point in the history
* Duplicates data from "setup.py" (for now;
  until: Python 2.7 support is dropped)
* NEEDED FOR: Newer pip versions
* HINT: "setup.py" will become DEPRECATED soon (approx. 2023-09).

OTHERWISE:

* Add SPDX-License-Identifier to "behave/__init__.py"
* UPDATE/TWEAK: py.requirements/*.txt
  • Loading branch information
jenisys committed Jul 31, 2023
1 parent 7b7d173 commit aebd197
Show file tree
Hide file tree
Showing 14 changed files with 323 additions and 59 deletions.
43 changes: 43 additions & 0 deletions .ruff.toml
@@ -0,0 +1,43 @@
# -----------------------------------------------------------------------------
# SECTION: ruff -- Python linter
# -----------------------------------------------------------------------------
# SEE: https://github.com/charliermarsh/ruff
# SEE: https://beta.ruff.rs/docs/configuration/#using-rufftoml
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.

select = ["E", "F"]
ignore = []

# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F", "G", "I", "N", "Q", "S", "T", "W",
"ANN", "ARG", "BLE", "COM", "DJ", "DTZ", "EM", "ERA", "EXE", "FBT", "ICN", "INP", "ISC",
"NPY", "PD", "PGH", "PIE", "PL", "PT", "PTH", "PYI", "RET", "RSE", "RUF", "SIM", "SLF",
"TCH", "TID", "TRY", "UP", "YTT"
]
unfixable = []

# Exclude a variety of commonly ignored directories.
exclude = [
".direnv",
".eggs",
".git",
".ruff_cache",
".tox",
".venv*",
"__pypackages__",
"build",
"dist",
"venv",
]
per-file-ignores = {}

# Same as Black.
# WAS: line-length = 88
line-length = 100

# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
target-version = "py310"

[mccabe]
max-complexity = 10
3 changes: 2 additions & 1 deletion LICENSE
@@ -1,4 +1,5 @@
Copyright (c) 2012-2014 Benno Rice, Richard Jones, Jens Engel and others, except where noted.
Copyright (c) 2012-2014 Benno Rice, Richard Jones and others, except where noted.
Copyright (c) 2014-2023 Jens Engel and others, except where noted.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Expand Up @@ -13,6 +13,7 @@ include *.rst
include *.txt
include *.yml
include *.yaml
exclude __*.txt
include bin/behave*
include bin/invoke*
recursive-include .ci *.yml
Expand All @@ -33,3 +34,4 @@ recursive-include py.requirements *.txt *.rst

prune .tox
prune .venv*
prune __*
4 changes: 3 additions & 1 deletion behave/__init__.py
@@ -1,5 +1,7 @@
# -*- coding: UTF-8 -*-
"""behave is behaviour-driven development, Python style
# SPDX-License-Identifier: BSD-2-Clause
"""
behave is behaviour-driven development, Python style
Behavior-driven development (or BDD) is an agile software development
technique that encourages collaboration between developers, QA and
Expand Down
39 changes: 35 additions & 4 deletions docs/install.rst
Expand Up @@ -48,13 +48,13 @@ to install the newest version from the `GitHub repository`_::

To install a tagged version from the `GitHub repository`_, use::

pip install git+https://github.com/behave/behave@<tag>
pip install git+https://github.com/behave/behave@<TAG>

where <tag> is the placeholder for an `existing tag`_.
where <TAG> is the placeholder for an `existing tag`_.

When installing extras, use ``<tag>#egg=behave[...]``, e.g.::
When installing extras, use ``<TAG>#egg=behave[...]``, e.g.::

pip install git+https://github.com/behave/behave@v1.2.7.dev3#egg=behave[toml]
pip install git+https://github.com/behave/behave@v1.2.7.dev4#egg=behave[toml]

.. _`GitHub repository`: https://github.com/behave/behave
.. _`existing tag`: https://github.com/behave/behave/tags
Expand All @@ -79,3 +79,34 @@ Installation Target Description

.. _`behave-contrib`: https://github.com/behave-contrib
.. _`pep-518`: https://peps.python.org/pep-0518/#tool-table


Specify Dependency to "behave"
------------------------------

Use the following recipe in the ``"pyproject.toml"`` config-file if:

* your project depends on `behave`_ and
* you use a ``version`` from the git-repository (or a ``git branch``)

EXAMPLE:

.. code-block:: toml
# -- FILE: my-project/pyproject.toml
# SCHEMA: Use "behave" from git-repository (instead of: https://pypi.org/ )
# "behave @ git+https://github.com/behave/behave.git@<TAG>"
# "behave @ git+https://github.com/behave/behave.git@<BRANCH>"
# "behave[VARIANT] @ git+https://github.com/behave/behave.git@<TAG>" # with VARIANT=develop, docs, ...
# SEE: https://peps.python.org/pep-0508/
[project]
name = "my-project"
...
dependencies = [
"behave @ git+https://github.com/behave/behave.git@v1.2.7.dev4",
# OR: "behave[develop] @ git+https://github.com/behave/behave.git@main",
...
]
.. _behave: https://github.com/behave/behave
3 changes: 2 additions & 1 deletion py.requirements/all.txt
Expand Up @@ -5,11 +5,12 @@
# pip install -r <THIS_FILE>
#
# SEE ALSO:
# * http://www.pip-installer.org/
# * https://pip.pypa.io/en/stable/user_guide/
# ============================================================================
# ALREADY: -r testing.txt
# ALREADY: -r docs.txt

-r basic.txt
-r behave_extensions.txt
-r develop.txt
-r jsonschema.txt
2 changes: 1 addition & 1 deletion py.requirements/basic.txt
Expand Up @@ -5,7 +5,7 @@
# pip install -r <THIS_FILE>
#
# SEE ALSO:
# * http://www.pip-installer.org/
# * https://pip.pypa.io/en/stable/user_guide/
# ============================================================================

cucumber-tag-expressions >= 4.1.0
Expand Down
15 changes: 15 additions & 0 deletions py.requirements/behave_extensions.txt
@@ -0,0 +1,15 @@

# ============================================================================
# PYTHON PACKAGE REQUIREMENTS: behave extensions
# ============================================================================
# DESCRIPTION:
# pip install -r <THIS_FILE>
#
# SEE ALSO:
# * https://pip.pypa.io/en/stable/user_guide/
# ============================================================================

# -- FORMATTERS:
# DISABLED: allure-behave
behave-html-formatter >= 0.9.10; python_version >= '3.6'
behave-html-pretty-formatter >= 1.9.1; python_version >= '3.6'
2 changes: 1 addition & 1 deletion py.requirements/ci.tox.txt
@@ -1,5 +1,5 @@
# ============================================================================
# BEHAVE: PYTHON PACKAGE REQUIREMENTS: ci.tox.txt
# PYTHON PACKAGE REQUIREMENTS: behave -- ci.tox.txt
# ============================================================================

-r testing.txt
Expand Down
4 changes: 2 additions & 2 deletions py.requirements/develop.txt
Expand Up @@ -15,9 +15,9 @@ bump2version >= 0.5.6

# -- RELEASE MANAGEMENT: Push package to pypi.
twine >= 1.13.0
build >= 0.5.1

# -- DEVELOPMENT SUPPORT:

# -- PYTHON2/3 COMPATIBILITY: pypa/modernize
# python-futurize
modernize >= 0.5
Expand All @@ -27,7 +27,7 @@ modernize >= 0.5

# -- REQUIRES: testing
-r testing.txt
coverage >= 4.2
coverage >= 5.0
pytest-cov
tox >= 1.8.1,<4.0 # -- HINT: tox >= 4.0 has breaking changes.
virtualenv < 20.22.0 # -- SUPPORT FOR: Python 2.7, Python <= 3.6
Expand Down
2 changes: 1 addition & 1 deletion py.requirements/docs.txt
@@ -1,5 +1,5 @@
# ============================================================================
# BEHAVE: PYTHON PACKAGE REQUIREMENTS: For documentation generation
# PYTHON PACKAGE REQUIREMENTS: behave -- For documentation generation
# ============================================================================
# REQUIRES: pip >= 8.0
# AVOID: sphinx v4.4.0 and newer -- Problems w/ new link check suggestion warnings
Expand Down
4 changes: 3 additions & 1 deletion py.requirements/jsonschema.txt
Expand Up @@ -3,5 +3,7 @@
# ============================================================================

# -- OPTIONAL: For JSON validation
# DEPRECATING: jsonschema
# USE INSTEAD: check-jsonschema
jsonschema >= 1.3.0
# MAYBE NOW: check-jsonschema
check-jsonschema

0 comments on commit aebd197

Please sign in to comment.