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

chore: tidy up makefile (DEV-1166) #223

Merged
merged 17 commits into from Sep 8, 2022
Merged

Conversation

jnussbaum
Copy link
Collaborator

resolves DEV-1166

@jnussbaum jnussbaum self-assigned this Sep 6, 2022
@@ -19,7 +19,6 @@ jobs:
python-version: 3.9
- name: Install dependencies
run: |
make upgrade-dist-tools
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I deleted this command. It is better to include the dist-tools as dev-dependencies (in the dev-section of Pipfile). This way, they get installed when make install-requirements is executed. We don't need a separate command just to install the dist-tools.

# Make targets for dsp-tools
#################################

.PHONY: clone-dsp-repo
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't need an extra command to clone the DSP-API. I included this in the dsp-stack command.

Makefile Outdated
.PHONY: stack-down
stack-down: ## stop dsp-stack and remove the cloned dsp-api repository
$(MAKE) -C .tmp/dsp-stack stack-down-delete-volumes
@sudo rm -rf .tmp
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For developer's machines, we need a command to stop the dsp-stack, otherwise it continues running for a long time, consuming resources.
The command to remove the .tmp folder needs a sudo because otherwise, it produces an error on GitHub (this error here: https://github.com/dasch-swiss/dsp-tools/runs/8204985409?check_suite_focus=true). The sudo wouln't be necessary for local machines, but for GitHub, it is necessary. If there are better solutions than sudo, I'm open for correction.

Choose a reason for hiding this comment

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

Is it necessary to remove the tmp folder? Why not just leave it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

make dsp-stack is the only place in the entire repo where the tmp folder is created. So it makes sense to me to delete it in the stack-down command, instead of the make clean command.

.PHONY: docs-publish
docs-publish: ## build and publish docs to GitHub Pages
mkdocs gh-deploy
mkdocs serve --dev-addr=0.0.0.0:7979
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  • docs-publish is not used anymore, because the docs are only on docs.dasch.swiss.
  • for mkdocs serve, I need another port, because the standard port is occupied on my machine.

pytest test/e2e/

.PHONY: test-unittests
test-unittests: ## run unit tests
pytest test/unittests/

.PHONY: local-tmp
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is now included at the only place where it is necessary: before cloning DSP-API.


.PHONY: help
help: ## show this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort

.PHONY: run
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This command is not necessary, IMHO.

@@ -32,6 +32,8 @@ wheel = "*"
pipenv-setup = "*"
pytest = "*"
types-requests = "*"
twine = "*"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These two dependencies were "hidden" until now in docs/requirements.txt and in make upgrade-dist-tools. I think they belong here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we use mkdocstrins at all - it's a Mkdocs plugin that generates documentation based on the docstrings in the source code... and we don't have that, as far as I know. So probably this could be removed, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I removed it, and GitHub CI runs through without errors. So I assume we really don't need it.

Copy link
Collaborator

@BalduinLandolt BalduinLandolt left a comment

Choose a reason for hiding this comment

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

I find those kinds of PRs rather hard to review properly... but from what I can tell, it looks good

@@ -32,6 +32,8 @@ wheel = "*"
pipenv-setup = "*"
pytest = "*"
types-requests = "*"
twine = "*"
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we use mkdocstrins at all - it's a Mkdocs plugin that generates documentation based on the docstrings in the source code... and we don't have that, as far as I know. So probably this could be removed, right?

reformat setup.py
Copy link

@irinaschubert irinaschubert left a comment

Choose a reason for hiding this comment

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

LGTM, just minor remarks/suggestions.

Makefile Show resolved Hide resolved
Makefile Outdated
.PHONY: stack-down
stack-down: ## stop dsp-stack and remove the cloned dsp-api repository
$(MAKE) -C .tmp/dsp-stack stack-down-delete-volumes
@sudo rm -rf .tmp

Choose a reason for hiding this comment

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

Is it necessary to remove the tmp folder? Why not just leave it?

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
docs/dsp-tools-information-for-developers.md Outdated Show resolved Hide resolved
@jnussbaum jnussbaum merged commit dca0854 into main Sep 8, 2022
@jnussbaum jnussbaum deleted the wip/dev-1166-improve-makefile branch September 8, 2022 07:32
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

3 participants