ODM2 / CZ-Manager

CZ Manager (formerly ODM2 Admin) is an application for site level data management of environmental observations using Observation Data Model 2 (ODM2) for documentation and a detailed walkthrough see:
http://odm2.github.io/CZ-Manager
MIT License
9 stars 12 forks source link

Common build/dev environment #90

Closed ocefpaf closed 7 years ago

ocefpaf commented 7 years ago

Not ready yet. I am testing the build/dev env on the CI and locally to get a working env for the future changes.

Pending on https://github.com/conda-forge/staged-recipes/pull/2197

miguelcleon commented 7 years ago

@ocefpaf I was able to build a conda python environment using odm2adminenv.yml and got it to run odm2 admin on my dev server! :) One Issue I did have is django-recaptcha caused an error so I added it to the environment manually but then everything worked. Here is the error I received: CondaValueError: Value error: invalid package specification: pip - django-recaptcha For example it is running the site here http://dev-odm2admin.cuahsi.org/LCZO/LCZO/mapdata.html

ocefpaf commented 7 years ago

@ocefpaf I was able to build a conda python environment using odm2adminenv.yml and got it to run odm2 admin on my dev server! :) One Issue I did have is django-recaptcha caused an error so I added it to the environment manually but then everything worked. Here is the error I received: CondaValueError: Value error: invalid package specification: pip - django-recaptcha For example it is running the site here http://dev-odm2admin.cuahsi.org/LCZO/LCZO/mapdata.html

I fixed a missing : in https://github.com/miguelcleon/ODM2-Admin/pull/90/commits/dba300b60c334109f0522da1a4c4b3dfa68bd08f. However, bare in mind that I plan to remove the odm2adminenv.yml file once django-recaptcha makes into the conda-forge channel, that file only serves as a workaround for a missing dependency.

That is because we should not keep two separate set of instructions (conda and pip, requirements.txt and environment.yml). I plan to merge both like I did in the .travis.yml so both conda and pip users can install ODM2-Admin from the requirements.txt

miguelcleon commented 7 years ago

oh well that's a simple fix. Now it worked without error! I created a fresh environment from the odm2adminenv.yml file and had no problems this time.

ocefpaf commented 7 years ago

oh well that's a simple fix.

Yep. I was purposely lazy with that file because, as I mention in https://github.com/miguelcleon/ODM2-Admin/pull/90#issuecomment-272246180, I mean to remove it once this PR is ready.

ocefpaf commented 7 years ago

@miguelcleon his is ready for review now.

PS: I added the linter checks to the allow_failures to prevent that from being a blocker for easy merges. But odm2adim is accumulating quite a few pep8 infractions. Those degrade the code quality and make it hard for third party contributors to help with the project.

https://travis-ci.org/miguelcleon/ODM2-Admin/jobs/191720679

miguelcleon commented 7 years ago

Great, thanks! I'll take a look. Thanks for pointing out the pep8 issues, these will be addressed.

miguelcleon commented 7 years ago

seems good to me.

miguelcleon commented 7 years ago

@ocefpaf should running setup.py install create the conda environment from the odm2adminenv.yml file?

ocefpaf commented 7 years ago

@ocefpaf should running setup.py install create the conda environment from the odm2adminenv.yml file?

No. setup.py does not work with odm2adminenv.yml. I guess that I should clarify a few things:

  1. Packaging for PyPI, and then conda, is not ready yet! There is a lot to be done to ensure a working package and I will submit more PRs soon.
  2. odm2adminenv.yml is conda specific and I will be recommending its removal in my next PR. (More details soon.)
  3. listing the dependencies in setup.py will try to fetch them. But your mileage will vary pending on the dependencies availability on PyPI.

Sadly the case for odm2admin, due to its dependency on psycopg2, is not an easy one. This problem will be worse if we add geodjango. Note that we do not have this issue with conda because we provide binaries for all the dependencies.

miguelcleon commented 7 years ago

Ok, right. Let me know when there is more stuff to test out.