Skip to content

Commit

Permalink
669 modernize packaging (#671)
Browse files Browse the repository at this point in the history
* use the build module instead of calling setup.py directly

* use pip install instead of calling setup.py directly

* ignore a file we produce in DB migrations

* add two missing __init__.py files

* add two packages which are not explicitly mentioned so far or found automatically

* changelog entry

* Prevent killing the terminal in case of a dry run

Signed-off-by: F.N. Claessen <felix@seita.nl>

---------

Signed-off-by: F.N. Claessen <felix@seita.nl>
Co-authored-by: F.N. Claessen <felix@seita.nl>
  • Loading branch information
nhoening and Flix6x committed May 8, 2023
1 parent e3dcf28 commit d615144
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -29,6 +29,7 @@ notebooks/.ipynb_checkpoints/

flexmeasures/ui/static/documentation
documentation/img/screenshot_*
generic_asset_fm_user_ownership.sql

uml_diagram.png
db_schema.png
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -46,7 +46,7 @@ install-deps:
pip-sync requirements/app.txt

install-flexmeasures:
python setup.py develop
pip install -e

install-pip-tools:
pip3 install -q "pip-tools>=6.4"
Expand Down
1 change: 1 addition & 0 deletions documentation/changelog.rst
Expand Up @@ -19,6 +19,7 @@ Infrastructure / Support
----------------------

* The setting FLEXMEASURES_PLUGINS can be set as environment variable now (as a comma-separated list) [see `PR #660 <https://www.github.com/FlexMeasures/flexmeasures/pull/660>`_]
* Packaging was modernized to stop calling setup.py directly [see `PR #671 <https://www.github.com/FlexMeasures/flexmeasures/pull/671>`_]
* Remove API versions 1.0, 1.1, 1.2, 1.3 and 2.0, while allowing hosts to switch between ``HTTP status 410 (Gone)`` and ``HTTP status 404 (Not Found)`` responses [see `PR #667 <https://www.github.com/FlexMeasures/flexmeasures/pull/667>`_]

.. warning:: The setting `FLEXMEASURES_PLUGIN_PATHS` has been deprecated since v0.7. It has now been sunset. Please replace it with :ref:`plugin-config`.
Expand Down
Empty file.
Empty file.
6 changes: 5 additions & 1 deletion setup.py
Expand Up @@ -26,7 +26,11 @@ def load_requirements(use_case):
install_requires=load_requirements("app"),
setup_requires=["setuptools_scm"],
use_scm_version={"local_scheme": "no-local-version"}, # handled by setuptools_scm
packages=find_packages(), # will include *.py files and some other types
packages=find_packages()
+ [
"flexmeasures.ui.templates",
"flexmeasures.ui.static",
], # will include *.py files and some other types
include_package_data=True, # now setuptools_scm adds all files under source control
entry_points={
"console_scripts": [
Expand Down
9 changes: 4 additions & 5 deletions to_pypi.sh
Expand Up @@ -66,12 +66,11 @@ pip -q install twine
pip -q install wheel

echo "[TO_PYPI] Packaging ..."
python setup.py egg_info sdist
python setup.py egg_info bdist_wheel
python -m build

if [ "$1" == "--dry-run" ]; then
echo "[TO_PYPI] Not uploading to Pypi (--dry-run active) ..."
exit
else
echo "[TO_PYPI] Uploading to Pypi ..."
twine upload dist/*
fi
echo "[TO_PYPI] Uploading to Pypi ..."
twine upload dist/*

0 comments on commit d615144

Please sign in to comment.