Skip to content

Commit

Permalink
Feature #461 move to pyproject.toml (#462)
Browse files Browse the repository at this point in the history
* 461: move to pyproject.toml for build

* 461: update docs and sonarQube
  • Loading branch information
John-Sharples authored Sep 18, 2024
1 parent a168ff7 commit 4aa40b1
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 31 deletions.
22 changes: 22 additions & 0 deletions docs/Users_Guide/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,28 @@ file at the top level of the repository.

.. literalinclude:: ../../requirements.txt

Install METplotpy
-------------------

METplotpy can be installed into a conda environment. First navigate to the
base directory, then run the following commands.

.. code-block:: ini
$ conda create -n "metplotpy" python=3.10.4 pip
$ conda activate metplotpy
(metplotpy)$ pip install -e .
This will install METplotpy into the conda env, along with all the dependancies
listed above in **requirements.txt**.

If you already have an environment setup, or want to install METplotpy without
the dependancies, add the `--no-deps` argument to pip.

.. code-block:: ini
$ pip install -e . --no-deps
.. _METcalcpy_conda:

Install METcalcpy in the Conda Environment
Expand Down
4 changes: 2 additions & 2 deletions internal/scripts/sonarqube/sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ sonar.projectKey=METplotpy
sonar.projectName=METplotpy
sonar.projectVersion=SONAR_PROJECT_VERSION
sonar.branch.name=SONAR_BRANCH_NAME
sonar.sources=metplotpy,test
sonar.coverage.exclusions=test/**
sonar.sources=metplotpy
sonar.coverage.exclusions=test/**,contributed/**
sonar.python.coverage.reportPaths=coverage.xml
sonar.sourceEncoding=UTF-8

Expand Down
7 changes: 7 additions & 0 deletions metplotpy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from distutils.util import convert_path

main_ns = {}
version_path = convert_path('docs/version')
with open(version_path) as version_file:
exec(version_file.read(), main_ns)
__version__ = main_ns['__version__']
35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
name = "metplotpy"
dynamic = ["version", "dependencies"]
description = "plotting package for METplus"
authors = [
{name = "METplus", email = "[email protected]"},
]
requires-python = ">=3.10.4"
readme = "README.md"
license = {text = "MIT"}
classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
]

[project.urls]
Homepage = "https://github.com/dtcenter/METplotpy"

[tool.setuptools.dynamic]
version = {attr = "metplotpy.__version__"}
dependencies = {file = ["requirements.txt"]}

[tool.setuptools]
packages = ["metplotpy"]

[tool.pytest.ini_options]
testpaths = ["test"]

[tool.coverage.run]
source = ["metplotpy/plots"]
29 changes: 0 additions & 29 deletions setup.py

This file was deleted.

0 comments on commit 4aa40b1

Please sign in to comment.