Skip to content
Snippets Groups Projects
Commit 14379775 authored by Mads M. Pedersen's avatar Mads M. Pedersen
Browse files

remove unused dependencies and move other to extra. install via pip install...

parent 87c2bbb5
No related branches found
No related tags found
1 merge request!227remove unused dependencies and move other to extra. install via pip install...
Pipeline #47942 failed
......@@ -13,10 +13,12 @@ test:
test
# except:
# - test_pypi
variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- git submodule sync --recursive
- git submodule update --init --recursive
- python -m pip install .
#- git submodule sync --recursive
#- git submodule update --init --recursive
- python -m pip install .[all]
- pip3 install pytest mock click
script:
- python3 -m pytest --cov-report term-missing:skip-covered --cov-report xml:coverage.xml --cov=wetb
......@@ -81,37 +83,24 @@ upload_package_local:
# ===== BUILD WHEELS AND UPLOAD TO PYPI =====
pypi_linux:
stage:
deploy
only:
- tags
- test_pypi
script:
- apt-get update
- pip install -e . --upgrade
- python3 -m pip install -U setuptools wheel
- python3 setup.py sdist bdist_wheel
- python3 -m pip install -U twine
- python3 -c 'from git_utils import rename_dist_file; rename_dist_file()'
- twine upload dist/* -u $TWINE_USERNAME -p $TWINE_PASSWORD
#- twine upload --repository-url https://test.pypi.org/legacy/ dist/* -u $TWINE_USERNAME -p $TWINE_PASSWORD # for testing purposes
upload_package_pypi:
image: continuumio/anaconda3:latest
tags:
- python
- docker, linux, shared
stage: deploy
needs:
- job: build_poetry_wheel
artifacts: true
- job: test
artifacts: false
pypi_windows:
stage:
deploy
script:
- pip install twine
- twine upload dist/* -u $TWINE_USERNAME -p $TWINE_PASSWORD
only:
- tags
- test_pypi
script:
- c:/Anaconda3/envs/WindEnergyToolbox/python.exe setup.py bdist_wheel
- twine upload dist/* -u %TWINE_USERNAME% -p %TWINE_PASSWORD%
#- twine upload --repository-url https://test.pypi.org/legacy/ dist/* -u %TWINE_USERNAME% -p %TWINE_PASSWORD% # for testing purposes
tags:
- CPAV_old
build_poetry_wheel:
stage: build
......
......@@ -4,21 +4,9 @@ Installation
===========================
Install C++ compilers (Windows)
--------------------------------
Your computer must have a C++ compiler installed in order to install
``wetb``. Windows users can follow the instructions on
`this page <https://wiki.python.org/moin/WindowsCompilers>`_ under
the section "14.2 standalone".
Normal user
--------------------------------
You must first have installed a C++ compiler before you can use these
commands. See section above.
* Quick install::
pip install wetb
......@@ -30,6 +18,14 @@ commands. See section above.
* Update an installation to the most recent version::
pip install --upgrade wetb
* Install with dependencies needed by prepost
pip install wetb[prepost]
* Install with all dependencies
pip install wetb[all]
**NOTE**. Dependency conflicts can arise if you do not install
``wetb`` into a clean environment. In particular, your installation
......@@ -47,5 +43,9 @@ Clone the repository and install a local editable copy::
git clone https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox.git
cd WindEnergyToolbox
pip install -e .
pip install -e .[all]
from wetb.hawc2.hawc2_input_writer import HAWC2InputWriter
from wetb.hawc2.tests import test_files
import os
def main():
if __name__ == '__main__':
# ======================================================================
# load master htc file path
# ======================================================================
path = os.path.dirname(test_files.__file__) + "/simulation_setup/DTU10MWRef6.0/"
htc_base_file = path + 'htc/DTU_10MW_RWT.htc'
h2writer = HAWC2InputWriter(htc_base_file)
# ======================================================================
# Set DLC definition module filename
# ======================================================================
definition_file = 'dlc_definition.py'
#=======================================================================
# Generate htc files from definition file, and print list of simulations
#=======================================================================
df = h2writer.from_definition(definition_file)
print(df)
main()
\ No newline at end of file
constants = {'simulation.time_stop':100}
variables = {'wind.wsp': [4, 6, 8],
'wind.tint': [0.1, 0.15, 0.2]}
functions = {'Name': lambda x: 'sim_wsp' + str(x['wind.wsp']) + '_ti' + str(x['wind.tint'])}
......@@ -8,30 +8,32 @@ readme = "README.md"
[tool.poetry.dependencies]
click = "^8.0.4"
Cython = "^0.29.35"
Cython = {version="^0.29.35", optional=true}
h5py = "^3.1.0"
Jinja2 = "^3.0.3"
lxml = "^4.9.2"
matplotlib = "^3.3.4"
mock = "^5.0.2"
numpy = ">=1.4"
openpyxl = "^3.1.2"
openpyxl = { version = "^3.1.2", optional = true }
pandas = "^1.1.5"
paramiko = "^3.2.0"
pbr = "^5.11.1"
paramiko = {version="^3.2.0", optional = true}
psutil = "^5.9.5"
pytest = "^7.0.1"
pytest-cov = "^4.0.0"
python = "^3.6"
scipy = ">=0.9.0"
six = "^1.16.0"
sshtunnel = "^0.4.0"
tables = "^3.7.0"
sshtunnel = {version="^0.4.0", optional = true}
tables = {version="^3.7.0", optional=true}
tqdm = "^4.64.1"
wafo = "^0.1.2"
xlwt = "^1.3.0"
wafo = {version="^0.1.2", optional=true}
xlwt = {version="^1.3.0", optional=true}
XlsxWriter = "^3.1.2"
[tool.poetry.extras]
prepost = ["openpyxl", "tables", "wafo", "xlwt", "Cython"]
all = ["openpyxl", "tables", "wafo", "xlwt", "Cython", "paramiko", "sshtunnel"]
[build-system]
requires = ["poetry-core"]
......
[metadata]
name = wetb
summary = Wind Energy Toolbox
author = DTU Wind Energy
author-email = mmpe@dtu.dk
license = GPLv3
home-page = https://gitlab.windenergy.dtu.dk/toolbox/WindEnergyToolbox
description-file = README
# Add here all kinds of additional classifiers as defined under
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
#classifiers = Development Status :: 4 - Beta,
# Programming Language :: Python,
# Programming Language :: Python :: 2.7,
# Programming Language :: Python :: 3,
# Programming Language :: Python :: 3.3,
# Programming Language :: Python :: 3.4,
# Programming Language :: Python :: 3.5,
# Programming Language :: Python :: 3.6,
# Environment :: Console,
# Intended Audience :: Education,
# Intended Audience :: Science/Research,
# License :: OSI Approved :: GPL License,
# Operating System :: OS Independent,
# Operating System :: POSIX :: Linux,
# Operating System :: Unix,
# Operating System :: MacOS,
# Operating System :: Microsoft :: Windows
# Topic :: Scientific/Engineering :: Mathematics
#
[entry_points]
# Add here console scripts like:
# console_scripts =
# hello_world = wetb.module:function
# as well as other entry_points.
[files]
# Add here 'data_files', 'packages' or 'namespace_packages'.
# Additional data files are defined as key value pairs of source and target:
packages =
wetb
# data_files =
# share/wetb_docs = docs/*
[extras]
# Add here additional requirements for extra features, like:
# PDF =
# ReportLab>=1.2
# RXP
#ALL =
# django
# cookiecutter
[test]
# py.test options when running `python setup.py test`
#addopts = tests
[tool:pytest]
# Options for py.test:
# Specify command line options as you would do when invoking py.test directly.
# e.g. --cov-report html (or xml) for html/xml output or --junitxml junit.xml
# in order to write a coverage file that can be read by Jenkins.
#addopts =
# --cov wetb --cov-report term-missing
# --verbose
python_files = WindEnergyToolbox/wetb/*
[aliases]
docs = build_sphinx
[bdist_wheel]
# Use this option if your package is pure-python
universal = 0
[build_sphinx]
# Options for Sphinx build
source_dir = docs
build_dir = docs/_build
[pbr]
# Let pbr run sphinx-apidoc
autodoc_tree_index_modules = True
# autodoc_tree_excludes = ...
# Let pbr itself generate the apidoc
# autodoc_index_modules = True
# autodoc_exclude_modules = ...
# Convert warnings to errors
# warnerrors = True
[devpi:upload]
# Options for the devpi: PyPI serer and packaging tool
# VCS export must be deactivated since we are using setuptools-scm
no-vcs = 1
formats = bdist_wheel
......@@ -4,6 +4,7 @@
Setup file for wetb.
"""
from distutils.extension import Extension
import os
from git_utils import write_vers
import sys
......@@ -28,9 +29,6 @@ with open("README.md", "r") as fh:
long_description = fh.read()
from distutils.extension import Extension
def setup_package(build_ext_switch=True):
# if build_ext_switch:
# import numpy as np
......@@ -51,28 +49,30 @@ def setup_package(build_ext_switch=True):
sphinx = ['sphinx'] if needs_sphinx else []
install_requires = ['mock',
'h5py',
#'tables', # Has blosc2 as requirement, fails unless C compiler is present on win32
# 'tables', # Has blosc2 as requirement, fails unless C compiler is present on win32
'pytest',
'pytest-cov',
# 'blosc', # gives an error - has to be pre-installed
'pbr',
'paramiko',
'scipy',
'pandas',
'matplotlib',
'coverage',
'xlwt',
'openpyxl',
'psutil',
'six',
'sshtunnel',
'Click',
'jinja2', ]
extras_require={
'prepost': [
'tables', # requires blosc2 and may not install on 32 bit systems without a C compiler
'cython',
]
extras_require = {
'prepost': [
'tables', # requires blosc2 and may not install on 32 bit systems without a C compiler
'cython',
'openpyxl',
],
'all': ['tables', # requires blosc2 and may not install on 32 bit systems without a C compiler
'cython',
'sshtunnel',
'openpyxl',
'paramiko',
]
}
setup(install_requires=install_requires,
......
......@@ -6,7 +6,7 @@ import mock
import pytest
import matplotlib.pyplot as plt
import sys
from examples import examples
from wetb import examples
from tests.run_main import run_module_main
......
File moved
File moved
from six import exec_
import time
import inspect
def get_time(f):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment