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

Feature/poetry #390

Merged
merged 3 commits into from
May 13, 2020
Merged

Feature/poetry #390

merged 3 commits into from
May 13, 2020

Conversation

li-wu
Copy link
Contributor

@li-wu li-wu commented May 7, 2020

Adopt poetry to manage build/dependencies/dev-dependencies/publish. Props:

  • Only one pyproject.toml to replace requirements.txt, MANIFEST.in, setup.py and setup.cfg.
  • Build, dependencies install, packaging and publish can be managed by poetry in a consistent way.
  • Auto detect virtualenv used by project.

@li-wu li-wu force-pushed the feature/poetry branch 15 times, most recently from 8cdf680 to 4778b2a Compare May 7, 2020 06:39
@echo 'Installing test requirements'
docker exec -i ${EVENTGEN_TEST_IMAGE} /bin/sh -c "pip3 install --upgrade pip;pip3 install -r $(shell pwd)/requirements.txt"
@echo 'Installing test dependencies'
docker exec -i ${EVENTGEN_TEST_IMAGE} /bin/sh -c "pip3 install poetry;poetry config virtualenvs.create false;poetry install --no-root"
Copy link
Contributor Author

@li-wu li-wu May 7, 2020

Choose a reason for hiding this comment

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

install poetry and disable poetry to use virtualenv so that the following tests can find dependent packages. Check here.

@@ -0,0 +1,1211 @@
[[package]]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The poetry.lock file is used for keep consistent environment for dependencies.

httplib2 = "^0.17.2"
uuid = "^1.30"

[tool.poetry.dev-dependencies]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dev dependencies are in a separate section which is more clear.

```
Eventgen uses [Poetry](https://github.com/python-poetry/poetry) to manage and build. Install `Poetry` first:
```
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also add instructions for installing poetry via pip?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, Jack.added.

@@ -1 +0,0 @@
{"version": "7.1.0"}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The version.json is now deleted. We use the version in pyproject.toml as single source.

@@ -48,32 +48,50 @@ def flush(self, q):
# This may cause the file exceed the maxFileBytes a little bit but will greatly improve the performance
try:
for metamsg in q:
msg = metamsg.get('_raw')
msg = metamsg.get("_raw")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The changes in this file are made by make format-all.

@li-wu li-wu merged commit b4886e6 into develop May 13, 2020
@alishamayor alishamayor deleted the feature/poetry branch July 22, 2020 02:51
@alishamayor alishamayor restored the feature/poetry branch July 22, 2020 02:52
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.

3 participants