diff --git a/.github/workflows/pr_check.yml b/.github/workflows/pr_check.yml index 41155fb..e3d5558 100644 --- a/.github/workflows/pr_check.yml +++ b/.github/workflows/pr_check.yml @@ -19,7 +19,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install Dependencies run: | - pip install .[test] + pip install .[dev] - name: Run Tests run: | python -m pytest diff --git a/README.rst b/README.rst index 65b5f63..8be2218 100644 --- a/README.rst +++ b/README.rst @@ -94,3 +94,26 @@ Examples: $ jdiff a.json b.json -i 2 -s symmetric $ jdiff a.yaml b.yaml -f yaml -s symmetric + +Development +----------- + +Install development dependencies and test locally with + +.. code-block:: bash + + pip install -r requirements-dev.txt + # ... do your work ... add tests ... + pytest + +Installing From Source +---------------------- + +To install from source run + +.. code-block:: bash + + pip install . + +This will install the library and cli for `jsondiff` as well as its runtime +dependencies. diff --git a/pyproject.toml b/pyproject.toml index 1245398..2c822cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] name = "jsondiff" description = "Diff JSON and JSON-like structures in Python" -dynamic = ["version"] +dynamic = ["version", "dependencies", "optional-dependencies"] readme = "README.rst" license= {file = "LICENSE" } requires-python = ">=3.8" @@ -17,15 +17,6 @@ classifiers = [ 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', ] -dependencies = [ - "pyyaml" -] - -[project.optional-dependencies] -test = [ - "hypothesis", - "pytest" -] [project.urls] "Homepage" = "https://github.com/xlwings/jsondiff" @@ -40,3 +31,7 @@ exclude = ["tests*"] [tool.setuptools.dynamic] version = {attr = "jsondiff.__version__"} +dependencies = {file=["requirements.txt"]} + +[tool.setuptools.dynamic.optional-dependencies] +dev = {file=["requirements-dev.txt"]} diff --git a/requirements-dev.txt b/requirements-dev.txt new file mode 100644 index 0000000..9a54149 --- /dev/null +++ b/requirements-dev.txt @@ -0,0 +1,2 @@ +hypothesis +pytest diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..c3726e8 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +pyyaml