Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-16081

error when trying to create a python package

    Details

    • Type: Bug
    • Status: Won't Fix
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: templates
    • Labels:
      None

      Description

      I received an error when trying to create a new python package using `templatekit`:

      [lsst@b3a8c92b6e26 foo]$ ls

      templates

      [lsst@b3a8c92b6e26 foo]$ cd templates

      [lsst@b3a8c92b6e26 templates]$ templatekit make stack_package -o ../

      package_name [example]: notify

      copyright_year [2018]

      Select copyright_holder:

      1 - Association of Universities for Research in Astronomy

      2 - California Institute of Technology

      3 - The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory

      4 - The Trustees of Princeton University

      5 - University of Illinois Champaign-Urbana

      6 - University of Washington

      Choose from 1, 2, 3, 4, 5, 6 [1]: 5

      Select github_org:

      1 - lsst

      2 - lsst-dm

      3 - lsst-sims

      4 - lsst-ts

      Choose from 1, 2, 3, 4 [1]: 2

      Select uses_cpp:

      1 - True

      2 - False

      Choose from 1, 2 [1]: 2

      Select uses_python:

      1 - True

      2 - False

      Choose from 1, 2 [1]: 1

      python_module [lsst.notify]

      python_sub_dirs [lsst/notify]

      Traceback (most recent call last):

        File "/opt/lsst/software/stack/python/miniconda3-4.3.21/bin/templatekit", line 11, in <module>

          load_entry_point('templatekit==0.0.0', 'console_scripts', 'templatekit')()

        File "/opt/lsst/software/stack/python/miniconda3-4.3.21/lib/python3.6/site-packages/click/core.py", line 722, in _call_

          return self.main(*args, **kwargs)

        File "/opt/lsst/software/stack/python/miniconda3-4.3.21/lib/python3.6/site-packages/click/core.py", line 697, in main

          rv = self.invoke(ctx)

        File "/opt/lsst/software/stack/python/miniconda3-4.3.21/lib/python3.6/site-packages/click/core.py", line 1066, in invoke

          return _process_result(sub_ctx.command.invoke(sub_ctx))

        File "/opt/lsst/software/stack/python/miniconda3-4.3.21/lib/python3.6/site-packages/click/core.py", line 895, in invoke

          return ctx.invoke(self.callback, **ctx.params)

        File "/opt/lsst/software/stack/python/miniconda3-4.3.21/lib/python3.6/site-packages/click/core.py", line 535, in invoke

          return callback(*args, **kwargs)

        File "/opt/lsst/software/stack/python/miniconda3-4.3.21/lib/python3.6/site-packages/click/decorators.py", line 27, in new_func

          return f(get_current_context().obj, *args, **kwargs)

        File "/opt/lsst/software/stack/python/miniconda3-4.3.21/lib/python3.6/site-packages/templatekit/scripts/make.py", line 57, in make

          _handle_project_template(template, output_path)

        File "/opt/lsst/software/stack/python/miniconda3-4.3.21/lib/python3.6/site-packages/templatekit/scripts/make.py", line 99, in _handle_project_template

          extra_context=None)

        File "/opt/lsst/software/stack/python/miniconda3-4.3.21/lib/python3.6/site-packages/cookiecutter/main.py", line 94, in cookiecutter

          output_dir=output_dir

        File "/opt/lsst/software/stack/python/miniconda3-4.3.21/lib/python3.6/site-packages/cookiecutter/generate.py", line 341, in generate_files

          overwrite_if_exists

        File "/opt/lsst/software/stack/python/miniconda3-4.3.21/lib/python3.6/site-packages/cookiecutter/generate.py", line 208, in render_and_create_dir

          raise OutputDirExistsException(msg)

      cookiecutter.exceptions.OutputDirExistsException: Error: "/home/lsst/foo/notify/python/lsst" directory already exists

      [lsst@b3a8c92b6e26 templates]

       

        Attachments

          Activity

          Hide
          jsick Jonathan Sick added a comment -

          I'm afraid I can't reproduce this issue:

          » templatekit make stack_package -o ../
          package_name [example]: notify
          copyright_year [2018]: 2018
          Select copyright_holder:
          1 - Association of Universities for Research in Astronomy
          2 - California Institute of Technology
          3 - The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory
          4 - The Trustees of Princeton University
          5 - University of Illinois Champaign-Urbana
          6 - University of Washington
          Choose from 1, 2, 3, 4, 5, 6 [1]: 5
          Select github_org:
          1 - lsst
          2 - lsst-dm
          3 - lsst-sims
          4 - lsst-ts
          Choose from 1, 2, 3, 4 [1]: 1
          Select uses_cpp:
          1 - True
          2 - False
          Choose from 1, 2 [1]: 2
          Select uses_python:
          1 - True
          2 - False
          Choose from 1, 2 [1]: 1
          python_module [lsst.notify]:
          python_sub_dirs [lsst/notify]:
          (post-gen hook) Moved root.h to include/lsst/notify.h
          (post-gen hook) Removing lib directory
          (post-gen hook) Removing src directory
          (post-gen hook) Removing include directory
          (post-gen hook) Removing doc/SConscript file
          (post-gen hook) Removing doc/doxygen.conf.in file
          (post-gen hook) Removing doc/notify directory
          

          Are you absolutely certain you didn't have a /home/lsst/foo/notify directory before?

          You can try rerunning but providing a different package name or a different output directory (o/-output option?

          Show
          jsick Jonathan Sick added a comment - I'm afraid I can't reproduce this issue: » templatekit make stack_package -o ../ package_name [example]: notify copyright_year [2018]: 2018 Select copyright_holder: 1 - Association of Universities for Research in Astronomy 2 - California Institute of Technology 3 - The Board of Trustees of the Leland Stanford Junior University, through SLAC National Accelerator Laboratory 4 - The Trustees of Princeton University 5 - University of Illinois Champaign-Urbana 6 - University of Washington Choose from 1, 2, 3, 4, 5, 6 [1]: 5 Select github_org: 1 - lsst 2 - lsst-dm 3 - lsst-sims 4 - lsst-ts Choose from 1, 2, 3, 4 [1]: 1 Select uses_cpp: 1 - True 2 - False Choose from 1, 2 [1]: 2 Select uses_python: 1 - True 2 - False Choose from 1, 2 [1]: 1 python_module [lsst.notify]: python_sub_dirs [lsst/notify]: (post-gen hook) Moved root.h to include/lsst/notify.h (post-gen hook) Removing lib directory (post-gen hook) Removing src directory (post-gen hook) Removing include directory (post-gen hook) Removing doc/SConscript file (post-gen hook) Removing doc/doxygen.conf.in file (post-gen hook) Removing doc/notify directory Are you absolutely certain you didn't have a /home/lsst/foo/notify directory before? You can try rerunning but providing a different package name or a different output directory ( o/ -output option?
          Hide
          spietrowicz Steve Pietrowicz added a comment -

          Yes, there was no /home/lsst/foo/notify directory before.  In fact, the first time this happened, I deleted the directory that was created and tried it again.  The first couple of lines above show the directory /home/lsst/foo only contains the directory templates.  

           

          It could have something to do with this running under docker.   I ran

          docker run -ti docker.io/lsstsqre/centos:7-stack-lsst_distrib-v15_0

          I'll try this again from scratch, and will let you know what happens.

          Show
          spietrowicz Steve Pietrowicz added a comment - Yes, there was no /home/lsst/foo/notify directory before.  In fact, the first time this happened, I deleted the directory that was created and tried it again.  The first couple of lines above show the directory /home/lsst/foo only contains the directory templates .     It could have something to do with this running under docker.   I ran docker run -ti docker.io/lsstsqre/centos:7-stack-lsst_distrib-v15_0 I'll try this again from scratch, and will let you know what happens.
          Hide
          spietrowicz Steve Pietrowicz added a comment -

          I tried it again with notify, and got the same error.

          Then I tried it by accepting the defaults for each question and had the same error.

          Show
          spietrowicz Steve Pietrowicz added a comment - I tried it again with notify , and got the same error. Then I tried it by accepting the defaults for each question and had the same error.
          Hide
          jsick Jonathan Sick added a comment -

          This is quite puzzling! I tried this again in the container you mention, and reproduced the steps (I see what you mean about locale not being set in the contains) and I still got it to work. It only failed if I made a second notify package.

          Show
          jsick Jonathan Sick added a comment - This is quite puzzling! I tried this again in the container you mention, and reproduced the steps (I see what you mean about locale not being set in the contains) and I still got it to work. It only failed if I made a second notify package.
          Hide
          spietrowicz Steve Pietrowicz added a comment -

          Hmmm.. I think the only thing I didn't document was that I ran the

          . ./loadLSST.bash

          before everything else I listed in order to get pip.

          Show
          spietrowicz Steve Pietrowicz added a comment - Hmmm.. I think the only thing I didn't document was that I ran the . ./loadLSST.bash before everything else I listed in order to get  pip .
          Hide
          spietrowicz Steve Pietrowicz added a comment - - edited

          I looked into this a bit more and was able to get this to work successfully.  I was also about to get it to fail reliably.

           

          When I initially ran this, I executed the commands in a directory in the container, not something backed by the underlying filesystem.  The directory I was using was /home/lsst.   My intent was to try out the commands to see how everything worked before I created the "real" repo files.    The /home/lsst directory is listed as of type overlay when you do a df.

           

          When I started the docker container like so: {quote}

          docker run -v `pwd`:`pwd` -w `pwd` -ti docker.io/lsstsqre/centos:7-stack-lsst_distrib-v15_0{quote}

           

          and ran the commands within the directory I specified, everything worked.  Next I moved back to /home/lsst, tried it, and it failed.

           

          I'm a little surprised that the error occurs. After seeing what's going on, it might be worth investigating a bit more, but I'm not sure it's worth fixing unless it's an easy fix. The circumstances in which this occurred are pretty unlikely to happen to someone else.

           

          Thoughts?

          Show
          spietrowicz Steve Pietrowicz added a comment - - edited I looked into this a bit more and was able to get this to work successfully.  I was also about to get it to fail reliably.   When I initially ran this, I executed the commands in a directory in the container, not something backed by the underlying filesystem.  The directory I was using was /home/lsst .   My intent was to try out the commands to see how everything worked before I created the "real" repo files.    The /home/lsst directory is listed as of type overlay when you do a df.   When I started the docker container like so: {quote} docker run -v `pwd`:`pwd` -w `pwd` -ti docker.io/lsstsqre/centos:7-stack-lsst_distrib-v15_0{quote}   and ran the commands within the directory I specified, everything worked.  Next I moved back to /home/lsst , tried it, and it failed.   I'm a little surprised that the error occurs. After seeing what's going on, it might be worth investigating a bit more, but I'm not sure it's worth fixing unless it's an easy fix. The circumstances in which this occurred are pretty unlikely to happen to someone else.   Thoughts?
          Hide
          jsick Jonathan Sick added a comment -

          Given that this hasn't come up from any other users, and it's not a normal usage pattern, I don't think we should really do any further action on this issue. Let me know if there's a clear next action.

          Show
          jsick Jonathan Sick added a comment - Given that this hasn't come up from any other users, and it's not a normal usage pattern, I don't think we should really do any further action on this issue. Let me know if there's a clear next action.

            People

            • Assignee:
              jsick Jonathan Sick
              Reporter:
              spietrowicz Steve Pietrowicz
              Watchers:
              Jonathan Sick, Steve Pietrowicz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel