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

[RtM] Documentation Improvements #663

Merged

Conversation

citibeth
Copy link
Member

When I see ways to improve the documentation, I put it here. Merge at your convenience.


It is recommend that the following be put in your ``.bashrc`` file::

alias less='less -R'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, you can set the LESS environment variable to contain R (I use LESS=-RIMF locally).

@gartung
Copy link
Member

gartung commented Apr 21, 2016

Thanks

@citibeth citibeth changed the title [WIP] Documentation Improvements [RtM] Documentation Improvements Jun 5, 2016
@becker33
Copy link
Member

becker33 commented Aug 1, 2016

If these issues still apply could you please rebase this to the tip of develop?

@tgamblin
Copy link
Member

Needs rebase then I can merge.

def url_for_version(self, version):
return 'http://example.com/version_%s/foo-%s.tar.gz' \
% (version, version)
version('8.2.1', '4136d7b4c04df68b686570afa26988ac')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think method definitions should always come at the end of Python classes. Can you switch the order of these two and add an empty line between them?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a Spack-specific exception to that rule should be made here. In Spack packages, we look for the URL just before the version numbers + checksums. It should not matter whether the URL is specified with url=... or url_for_version(). I will leave this as-is unless further debate settles it otherwise.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, every package that uses url_for_version that is currently in Spack puts the url_for_version method with all of the other methods...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tgamblin Any opinions?

The full example in question is as follows:

   class Foo(Package):
       def url_for_version(self, version):
           return 'http://example.com/version_%s/foo-%s.tar.gz' \
               % (version, version)
       version('8.2.1', '4136d7b4c04df68b686570afa26988ac')
       ...

How would this change if we were to enforce url_for_version() below?
Would we need the following? Would it be more / less clear in context of
other examples of Foo that just use url=?

   class Foo(Package):
       version('8.2.1', '4136d7b4c04df68b686570afa26988ac')
       ...
       def url_for_version(self, version):
           return 'http://example.com/version_%s/foo-%s.tar.gz' \
               % (version, version)

On Tue, Aug 23, 2016 at 4:39 PM, Adam J. Stewart notifications@github.com
wrote:

In lib/spack/docs/packaging_guide.rst:

@@ -385,19 +387,28 @@ in the package. For example, Spack is smart enough to download
version 8.2.1. of the Foo package above from
http://example.com/foo-8.2.1.tar.gz http://example.com/foo-8.2.1.tar.gz.

-If spack cannot extrapolate the URL from the url field, or if
-the package doesn't have a url field, you can add a URL explicitly
+If spack cannot extrapolate the URL from the url field by
+default, you can write your own URL generation algorithm in place of
+the url declaration. For example:
+
+.. code-block:: python

  • :linenos:
  • class Foo(Package):
  •   def url_for_version(self, version):
    
  •       return 'http://example.com/version_%s/foo-%s.tar.gz' \
    
  •           % (version, version)
    
  •   version('8.2.1', '4136d7b4c04df68b686570afa26988ac')
    

Also, every package that uses url_for_version that is currently in Spack
puts the url_for_version method with all of the other methods...


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/LLNL/spack/pull/663/files/0736807da5cd4bbc89c8f4cbd54d60d8cf128fc4#r75946143,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB1cdwXTvu9oXxVSYMUmTWU7X8MY5CQmks5qi1qQgaJpZM4H5he8
.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree with @adamjstewart here, it reads better to have url_for_version below version definitions.

@citibeth citibeth force-pushed the efischer/160327-DocumentationImprovements branch from 0736807 to 8a481e7 Compare August 23, 2016 20:39
@citibeth
Copy link
Member Author

OK it's rebased.

@citibeth
Copy link
Member Author

I don't agree with the position of url_for_version(), but I just did it because this PR needs to get merged and not held up any longer. @tgamblin can it merge now?

@adamjstewart
Copy link
Member

LGTM

@tgamblin tgamblin merged commit e9bc3a9 into spack:develop Aug 25, 2016
@citibeth citibeth deleted the efischer/160327-DocumentationImprovements branch October 6, 2016 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants