Skip to content

Conversation

TomVasile
Copy link
Contributor

@TomVasile TomVasile commented Apr 21, 2020

Fixes issue where dist directory is assumed to be in the base directory. With this change, you can specify if that directory exists elsewhere.

Edit: Also fixed build dependencies since I was unable to build the project in it's current state without them.

@TomVasile TomVasile marked this pull request as draft April 21, 2020 20:40
@TomVasile TomVasile changed the title use nested dist if setup.py is not in main directory include option for nested dist Apr 21, 2020
@TomVasile TomVasile marked this pull request as ready for review April 21, 2020 21:49
.drone.yml Outdated
image: golang:1.11-alpine
commands:
- apk --no-cache add -U python3 git
- apk --no-cache add -U python3 git python3-dev gcc libc-dev libffi-dev openssl-dev
Copy link

Choose a reason for hiding this comment

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

These changes don't seem to be related to this PR, just like changes below in Dockerfiles

Copy link
Contributor Author

@TomVasile TomVasile Apr 22, 2020

Choose a reason for hiding this comment

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

@lafriks You can't build the project without these changes currently. See CI failures without them: https://cloud.drone.io/drone-plugins/drone-pypi/53/1/4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lafriks @tboerger Please advise

@TomVasile TomVasile requested a review from lafriks April 24, 2020 19:21
@lafriks
Copy link

lafriks commented Apr 24, 2020

@tboerger could be more help in this as I'm not familiar with this plugin that much

@TomVasile
Copy link
Contributor Author

Also I just noticed this, these dependency changes were approved already and were never merged.

#25

@lafriks
Copy link

lafriks commented Apr 24, 2020

Can you revise?

@TomVasile
Copy link
Contributor Author

Can you revise?

I can if you merge the other PR, the project does not build without those changes. Or close that PR and have them just merge in with mine. Whichever you guys prefer.

@TomVasile
Copy link
Contributor Author

@lafriks Please let me know what you would like me to do here.

plugin.go Outdated
args = append(args, "--password")
args = append(args, p.Password)
args = append(args, "dist/*")
args = append(args, filepath.Join(filepath.Dir(p.DistDir), "/*"))
Copy link
Member

Choose a reason for hiding this comment

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

you can simplify to this:

filepath.Join(p.DistDir, "/*")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bradrydzewski Thanks! Pushed this change.

@tboerger
Copy link
Contributor

Please rebase as the other PR have been merged.

@TomVasile
Copy link
Contributor Author

Please rebase as the other PR have been merged.

@tboerger Done

@bradrydzewski
Copy link
Member

quick question ... wondering if we could simplify this a bit further?

		cli.StringFlag{
			Name:	"dist_dir",
			Usage:  "used when distribution directory is not in build root",
-			Value:  "dist/",
+			Value:  "dist/*",
			EnvVar: "PLUGIN_DIST_DIR",
		},
-args = append(args, filepath.Join(p.DistDir, "/*"))
+args = append(args, p.DistDir)

@TomVasile
Copy link
Contributor Author

TomVasile commented Apr 29, 2020

quick question ... wondering if we could simplify this a bit further?

@bradrydzewski

So the reason I did it that way was so that the end user didn't have to specify dist/<files or *> but only the path to which the dist directory is located.

I guess I could change it to be a "path_to_dist_file(s)" envvar.

What are your thoughts? I'm kind of indifferent as both fit my use case.

@bradrydzewski
Copy link
Member

I think the below patch is preference since it is more consistent for how we handle this with other plugins.

		cli.StringFlag{
			Name:	"dist_dir",
			Usage:  "used when distribution directory is not in build root",
-			Value:  "dist/",
+			Value:  "dist/*",
			EnvVar: "PLUGIN_DIST_DIR",
		},
-args = append(args, filepath.Join(p.DistDir, "/*"))
+args = append(args, p.DistDir)

@TomVasile
Copy link
Contributor Author

@bradrydzewski Sounds good, will pick this back up shortly.

@bradrydzewski bradrydzewski merged commit fa25cef into drone-plugins:master May 11, 2020
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.

4 participants