Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use declarative setuptools configuration and PyPI build tools #73

Merged
merged 1 commit into from
Apr 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .flake8

This file was deleted.

5 changes: 5 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,8 @@ jobs:
- name: Run mypy
run: |
mypy --install-types --non-interactive --ignore-missing-imports .
- name: Build and check packages
run: |
pip install --upgrade build twine
python -m build
twine check --strict dist/*
16 changes: 10 additions & 6 deletions guide-to-publish.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# How to publish to PyPi
# How to publish to PyPI

1) If present remove build and dist folder

Expand All @@ -8,17 +8,21 @@ On powershell you can do this with
rm -r *.egg-info
```

3) If not done yet, install twine via
3) If not done yet, install build and twine via
```
pip install twine
pip install build twine
```
4) Update the version number in the setup.py file.
4) Update the version number in `xmipy/__init__.py`.

5) Re-create the wheels:
```
python setup.py sdist bdist_wheel
python -m build
```
6) Re-upload the new files:
6) Check the package files:
```
twine check dist/*
```
7) Re-upload the new files:
```
twine upload dist/*
```
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[tool.isort]
profile = "black"
multi_line_output = 3
59 changes: 59 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[metadata]
name = xmipy
version = attr: xmipy.__version__
description = xmipy is an extension to the bmipy Python package
long_description = file: README.md
long_description_content_type = text/markdown
author = Martijn Russcher, Julian Hofer, Joseph D. Hughes
author_email = Martijn.Russcher@deltares.nl, Julian.Hofer@deltares.nl, jdhughes@usgs.gov
license = CC0
license_files = LICENSE
platform = Windows, Mac OS-X, Linux
classifiers =
Intended Audience :: Science/Research
License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
Topic :: Scientific/Engineering :: Hydrology
url = https://github.com/Deltares/xmipy
download_url = https://pypi.org/project/xmipy/

[options]
zip_safe = False
packages = find:
python_requires = >=3.7
install_requires =
bmipy
numpy

[options.extras_require]
tests =
pytest
pytest-cov
requests
mfpymake
flopy
lint =
mypy
black
isort

[options.package_data]
xmipy = py.typed

[flake8]
exclude =
.git,
__pycache__,
autotest
ignore =
# https://flake8.pycqa.org/en/latest/user/error-codes.html
F401, # 'module' imported but unused
# https://pycodestyle.readthedocs.io/en/latest/intro.html#error-codes
E402, # module level import not at top of file
W292, # no newline at end of file
W293, # blank line contains whitespace
W391, # blank line at end of file
W503, # line break before binary operator
W504, # line break after binary operator
E203 # whitespace before ':'
statistics = True
max-line-length = 92
60 changes: 0 additions & 60 deletions setup.py

This file was deleted.

Empty file added xmipy/timers/__init__.py
Empty file.