-
Notifications
You must be signed in to change notification settings - Fork 27
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
Add description field to package metadata #174
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,7 +117,12 @@ import Nirum.Package ( BoundModule | |
, types | ||
) | ||
import Nirum.Package.Metadata ( Author (Author, name, email) | ||
, Metadata (Metadata, authors, target, version) | ||
, Metadata (Metadata | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A space should be inserted after the opening parenthesis (so that parentheses are vertically aligned with commas) e.g.: , Metadata ( Metadata
, authors |
||
, authors | ||
, target | ||
, version | ||
, description | ||
) | ||
, MetadataError ( FieldError | ||
, FieldTypeError | ||
, FieldValueError | ||
|
@@ -1186,6 +1191,7 @@ if sys.version_info < (3, 0): | |
setup( | ||
name='{pName}', | ||
version='{pVersion}', | ||
description=$pDescription, | ||
author=$author, | ||
author_email=$authorEmail, | ||
package_dir=\{'': SOURCE_ROOT}, | ||
|
@@ -1207,6 +1213,10 @@ setup( | |
pName = packageName $ target metadata' | ||
pVersion :: Code | ||
pVersion = SV.toText $ version metadata' | ||
pDescription :: Code | ||
pDescription = case description metadata' of | ||
Just value -> T.intercalate "" ["'", value, "'"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It can be broken if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You're right! How about this change? pDescription = case description metadata' of
Just value -> stringLiteral value There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So I'll fix like above. Thank you! |
||
Nothing -> "None" | ||
strings :: [Code] -> Code | ||
strings values = T.intercalate ", " $ map stringLiteral (L.sort values) | ||
author :: Code | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,12 @@ import Nirum.Package ( BoundModule (boundPackage, modulePath) | |
, scanPackage | ||
, types | ||
) | ||
import Nirum.Package.Metadata ( Metadata (Metadata, authors, target, version) | ||
import Nirum.Package.Metadata ( Metadata (Metadata | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A space should be inserted after the opening parenthesis (so that parentheses are vertically aligned with commas) e.g.: , Metadata ( Metadata
, authors |
||
, authors | ||
, target | ||
, version | ||
, description | ||
) | ||
, MetadataError (FormatError) | ||
, Target (targetName) | ||
) | ||
|
@@ -56,6 +61,7 @@ createPackage metadata' modules' = | |
createValidPackage :: t -> Package t | ||
createValidPackage t = createPackage Metadata { version = SV.initial | ||
, authors = [] | ||
, description = Nothing | ||
, target = t | ||
} validModules | ||
|
||
|
@@ -103,6 +109,7 @@ testPackage target' = do | |
] :: [(ModulePath, Module)] | ||
metadata' = Metadata { version = SV.version 0 3 0 [] [] | ||
, authors = [] | ||
, description = Nothing | ||
, target = target' | ||
} | ||
metadata package `shouldBe` metadata' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,11 @@ import Nirum.Constructs.TypeExpression ( TypeExpression ( ListModifier | |
) | ||
import Nirum.Package (Package (metadata, modules), resolveBoundModule) | ||
import Nirum.Package.Metadata ( Author (Author, email, name, uri) | ||
, Metadata (Metadata, authors, target, version) | ||
, Metadata (Metadata | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A space should be inserted after the opening parenthesis (so that parentheses are vertically aligned with commas) e.g.: , Metadata ( Metadata
, authors There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I'll update it. Thank you! |
||
, authors | ||
, target | ||
, version | ||
, description) | ||
, Target (compilePackage) | ||
) | ||
import qualified Nirum.Package.ModuleSet as MS | ||
|
@@ -95,6 +99,7 @@ makeDummySource' pathPrefix m renames = | |
, uri = Nothing | ||
} | ||
] | ||
, description = Just "Package description" | ||
, target = Python "sample-package" minimumRuntime renames | ||
} | ||
pkg :: Package Python | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
version = "0.3.0" | ||
description = "Package description" | ||
|
||
[[authors]] | ||
name = "nirum" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A space should be inserted after the opening parenthesis (so that parentheses are vertically aligned with commas) e.g.: