DHI / mikeio

Read, write and manipulate dfs0, dfs1, dfs2, dfs3, dfsu and mesh files.
https://dhi.github.io/mikeio
BSD 3-Clause "New" or "Revised" License
139 stars 55 forks source link

Release mikeio on conda-forge #86

Closed georgebv closed 3 years ago

georgebv commented 4 years ago

Is your feature request related to a problem? Please describe. Library is available only via PyPI and github.

Describe the solution you'd like Many people in engineering community use Anaconda distribution of Python. This is especially important because some libraries cannot be built on Windows via pip and conda provides pre-compiled binaries of those (recent example - numpy, though they have added wheels on PyPI so its not an issue anymore).

jsmariegaard commented 4 years ago

Good point. I wonder what it takes to do that.

georgebv commented 4 years ago

@jsmariegaard it's really simple, instructions are given here. You create a recipe in yaml format and submit a PR to conda-forge/staged-recipes. It pulls your code from PyPI and, optionally, executes build commands for a given OS (looks like mikeio is purepython, so its going to be simple noarch).

ecomodeller commented 4 years ago

It seems like a great idea @georgebv if you would be willing to create a (draft) recipe for mikeio in a PR, I will be happy to add support for conda-forge

georgebv commented 4 years ago

@ecomodeller The way I did it before is that I forked https://github.com/conda-forge/staged-recipes and then submitted back a PR with recipe for my library (giving links below as example):

If I submit a PR for conda-forge myself this would make me the owner of mikeio on conda-forge, which you probably don't want. Unless you want a conda-forge recipe inside the mikeio repository itself - I think you shouldn't because this way you will have the same file you'll need to maintain in two places. I suggest you fork conda-forge, submit a draft PR, and I could help you with recipe there.

georgebv commented 3 years ago

I think I can help you with creating the conda-forge release and then transfer control of the repo if you are OK with it.

I am trying to speed this up because using pip on Windows is not an option for us since we use some packages which are compiled and are available via conda and you also do not support linux yet.

ecomodeller commented 3 years ago

Sounds great to me! You can see my attempt here: https://github.com/conda-forge/staged-recipes/pull/12835

georgebv commented 3 years ago

I have created a new recipe here https://github.com/conda-forge/staged-recipes/pull/13228. Hopefully we can get some progress with it next week.

I noticed that you don't distribute license with the package - I suggest you add this line to your MANIFEST.in include License.txt (this is also used by conda).

georgebv commented 3 years ago

@ecomodeller the build is working with license temporarily placed within the feedstock, but now the unit tests are failing. There is an issues with paths.

A line like this os.path.join("tests", "testdata", "da_diagnostic.dfs0") works only if you run your tests from specific location. I would suggest to create conftest.py and dispatch your test files to tests as fixtures. This is an example showing how I did this in one of my repositories https://github.com/georgebv/pyextremes/blob/master/tests/conftest.py. This may mean rewriting many tests, but in the long run it will be much easier to maintain.

Here's the job log showing errors https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=241482&view=logs&j=240f1fee-52bc-5498-a14a-8361bde76ba0&t=23010c01-6a9d-5f94-9037-792618644b77

georgebv commented 3 years ago

@ecomodeller the conda release was approved and they need your comment in this thread https://github.com/conda-forge/staged-recipes/pull/13228 saying that you agree to be the maintainer

jsmariegaard commented 3 years ago

Does closing this issue mean that we can now:

> conda install --channel=conda-forge mikeio

?

georgebv commented 3 years ago

@jsmariegaard yes, you can install it like that or via conda install -c conda-forge mikeio. I have already started using it and, for all intents and purposes, it works. Currently me and @ecomodeller are maintainers of the feedstock. This weekend I am planning to fork the mikeio repo and propose a PR with conda badge and installation instructions for README.

There are a few things, however, that need to be updated in the mikeio repo to better work with conda - mainly, test fixtures. I am planning to propose a series of PR's for that in the coming months, but that's a different topic.

jsmariegaard commented 3 years ago

Thanks a lot for your on this @georgebv !

ecomodeller commented 3 years ago

Thanks again @georgebv , for setting this up. I updated the version on pypi, and with minimal effort it flows through to conda-forge as well. I will get back to you when we have a version of mikeio for both Windows and Linux, I suppose this needs to be handled.