Skip to content

Commit

Permalink
Merge pull request #23 from dnv-opensource/move-config-from-setup-cfg…
Browse files Browse the repository at this point in the history
…-to-pyproject-toml

Move config from setup cfg to pyproject toml
  • Loading branch information
ClaasRostock authored Feb 21, 2024
2 parents 59728c0 + c224731 commit af4c683
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 117 deletions.
5 changes: 1 addition & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"terminal.integrated.env.windows": {
"PYTHONPATH": "${workspaceFolder}/src"
},
"python.terminal.activateEnvInCurrentTerminal": true,
"python.languageServer": "Pylance",
"ruff.importStrategy": "fromEnvironment",
Expand Down Expand Up @@ -42,4 +39,4 @@
"includeAllSymbols": true,
},
],
}
}
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,24 @@ The changelog format is based on [Keep a Changelog](https://keepachangelog.com/e

## [Unreleased]

* -/-


## [0.3.6] - 2024-02-21

### Added
* README.md : Under `Development Setup`, added a step to install current package in "editable" mode, using the pip install -e option.
This removes the need to manually add /src to the PythonPath environment variable in order for debugging and tests to work.

### Removed
* VS Code settings: Removed the setting which added the /src folder to PythonPath. This is no longer necessary. Installing the project itself as a package in "editable" mode, using the pip install -e option, solves the issue and removes the need to manually add /src to the PythonPath environment variable.

### Changed
* Moved all project configuration from setup.cfg to pyproject.toml
* Moved all tox configuration from setup.cfg to tox.ini.
* Moved pytest configuration from pyproject.toml to pytest.ini
* Deleted setup.cfg

### Dependencies
* updated to black[jupyter]==24.1 (from black[jupyter]==23.12)
* updated to version: '==24.1' (from version: '==23.12')
Expand Down Expand Up @@ -290,7 +308,8 @@ Users are encouraged to update to this version.
* Added support for Python 3.10

<!-- Markdown link & img dfn's -->
[unreleased]: https://github.com/dnv-opensource/farn/compare/v0.3.5...HEAD
[unreleased]: https://github.com/dnv-opensource/farn/compare/v0.3.6...HEAD
[0.3.6]: https://github.com/dnv-opensource/farn/compare/v0.3.5...v0.3.6
[0.3.5]: https://github.com/dnv-opensource/farn/compare/v0.3.4...v0.3.5
[0.3.4]: https://github.com/dnv-opensource/farn/compare/v0.3.3...v0.3.4
[0.3.3]: https://github.com/dnv-opensource/farn/compare/v0.3.2...v0.3.3
Expand Down
16 changes: 4 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,14 @@ _For a detailed documentation of the dictIO dict file format used by farn, see [
```sh
(.venv) $ pip install -r requirements-dev.txt
```
This should return without errors.
5. Setup your development environment to locate Python source codes:
For example, Visual Studio Code on Windows assumes the Python environment is specified in a `.env` file. <br>
If you are developing and running the Python code from VSCode, make sure to create a `.env` file in the mypackage root folder with below content. <br>
Set the path for `PROJ_DIR` to where your mypackage folder is on your system. <br>
_Note_: `.env` is part of `.gitignore`, such that you do not commit your `.env` file to the repository.
```ini
PROJ_DIR=<path-to-farn-root-dir>
PYTHONPATH=${PROJ_DIR}/src
Finally, install farn itself, yet not as a regular package but as an _editable_ package instead, using the pip install option -e:
```sh
(.venv) $ pip install -e .
```
6. Test that the installation works (in the mypackage root folder):
5. Test that the installation works (in the farn root folder):
```sh
(.venv) $ pytest .
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = "Frank Lumpitzsch, Claas Rostock, Seung Hyeon Yoo"

# The full version, including alpha/beta/rc tags
release = "0.3.5"
release = "0.3.6"

# -- General configuration ---------------------------------------------------

Expand Down
65 changes: 60 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,66 @@
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "farn"
version = "0.3.6"
description = "Python package to generate an n-dimensional case folder structure applying linear and spatial sampling strategies."
readme = "README.md"
requires-python = ">= 3.9"
license = {file = "LICENSE"}
authors = [
{name = "Frank Lumpitzsch", email = "[email protected]"},
{name = "Claas Rostock", email = "[email protected]"},
]
maintainers = [
{name = "Claas Rostock", email = "[email protected]"},
]
keywords = []
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"lxml>=5.1",
"numpy>=1.26",
"scipy>=1.12",
"pandas>=2.2",
"matplotlib>=3.8",
"Pillow>=10.2",
"pyDOE3>=1.0",
"psutil>=5.9",
"hilbertcurve>=2.0.5",
"dictIO>=0.3.3",
"ospx>=0.2.13",
]

[project.urls]
Homepage = "https://github.com/dnv-opensource/farn"
Documentation = "https://dnv-opensource.github.io/farn/README.html"
Repository = "https://github.com/dnv-opensource/farn.git"
Issues = "https://github.com/dnv-opensource/farn/issues"
Changelog = "https://github.com/dnv-opensource/farn/blob/main/CHANGELOG.md"

[project.scripts]
farn = "farn.cli.farn:main"
batchProcess = "farn.run.cli.batchProcess:main"

[tool.setuptools.packages.find]
where = ["src"]
exclude = ["test*"]

[tool.black]
line-length = 120
target-version = ["py39", "py310", "py311", "py312"]
Expand Down Expand Up @@ -109,8 +169,3 @@ reportUntypedNamedTuple = "warning"
# reportUnnecessaryTypeIgnoreComment = "information"
# reportImportCycles = "warning"
# reportImplicitStringConcatenation = "warning"

[tool.pytest.ini_options]
testpaths = "tests"
addopts = "--strict-markers"
xfail_strict = true
5 changes: 5 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
testpaths =
tests
addopts = --strict-markers
xfail_strict = True
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ pyDOE3>=1.0
psutil>=5.9
hilbertcurve>=2.0.5

dictIO>=0.3.1
ospx>=0.2.12
dictIO>=0.3.3
ospx>=0.2.13

# ../dictIO
# ../ospx
92 changes: 0 additions & 92 deletions setup.cfg

This file was deleted.

27 changes: 27 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[tox]
isolated_build = True
envlist = py{39,310,311,312}-{linux,macos,windows}
# envlist = py{39,310,311,312}-{windows}
# envlist = py{39,310,311,312}

[coverage:paths]
source =
src/farn
*/site-packages/farn

[coverage:run]
source = farn
branch = True

[coverage:report]
fail_under = 10.0
show_missing = True
skip_covered = True

[testenv]
system_site_packages = True
deps =
pytest>=7.4
pytest-cov>=4.1
commands =
pytest --cov --cov-config tox.ini {posargs}

0 comments on commit af4c683

Please sign in to comment.