Skip to content

Conversation

@MarshalX
Copy link
Contributor

@MarshalX MarshalX commented May 9, 2023

  • add dynamic version from one source (from VCS tags)

@MarshalX MarshalX force-pushed the CM-22829-migrate-the-project-to-Poetry-and-rework-versioning-flow branch from 2116df2 to dda0b77 Compare May 9, 2023 11:23
@MarshalX
Copy link
Contributor Author

MarshalX commented May 9, 2023

Some useful info to understand all things better

Including config files to the package

Unlike setuptools poetry bundles automatically all files within your package folder into your package

It means our config.yml files are already included by default. I test it locally by run "poetry build" and unarchive the dist files. it works

We should not use data_files anymore

https://github.com/cycodehq-public/cycode-cli/blob/a0ca07f91cef2ea333f21c0d58dd58f32f39c0b4/setup.py#L18
why:

  1. deprecated. ref: https://setuptools.pypa.io/en/latest/references/keywords.html
image
  1. relates only to setuptools
  2. not recommended at all (include_package_data should be used instead)

We don't use setuptools anymore

Poetry core fully covers our requirements. It automatically understand type of README, fetch the content from the file and so on

Now we distribute 1 package inside of one PyPI project

Previously our PyPi project contained 2 packages: cli, cyclient. This could lead to problems. Let's take a look at how our package is installed in the system (pip install cycode && pip uninstall cycode):

image

as we can see it creates 2 folders in the global system space for all Python packages. to be more specific to "site-packages" folder. And it's named "cli"

image

The name doesn't relate to cycode at all. Any other packages named "cli" will break something due to conflicts in the file system :(

also, I want to mention, that if we want to provide a separate cyclient package we should distribute it separately on PyPi (in case we want to provide Open Source lib to communicate with our backend from a code. I mean without CLI)

That's how the tree looks now after restructuring

image

But it breaks imports. @MichalBor let me know if some of our projects uses CLI by importing it directly in the code instead of interacting with command line interface

Rework of versioning is coming soon. More details in the task

@MichalBor
Copy link
Contributor

@MarshalX I think the cycode runner use the cli as a package.
@artem-fedorov correct me if im wrong

@MichalBor
Copy link
Contributor

Some useful info to understand all things better

Including config files to the package

Unlike setuptools poetry bundles automatically all files within your package folder into your package

It means our config.yml files are already included by default. I test it locally by run "poetry build" and unarchive the dist files. it works

We should not use data_files anymore

https://github.com/cycodehq-public/cycode-cli/blob/a0ca07f91cef2ea333f21c0d58dd58f32f39c0b4/setup.py#L18

why:

  1. deprecated. ref: https://setuptools.pypa.io/en/latest/references/keywords.html
image 3. relates only to setuptools 4. not recommended at all ([include_package_data](https://setuptools.pypa.io/en/latest/userguide/datafiles.html) should be used instead)

We don't use setuptools anymore

Poetry core fully covers our requirements. It automatically understand type of README, fetch the content from the file and so on

Now we distribute 1 package inside of one PyPI project

Previously our PyPi project contained 2 packages: cli, cyclient. This could lead to problems. Let's take a look at how our package is installed in the system (pip install cycode && pip uninstall cycode):

image as we can see it creates 2 folders in the **global system space** for all Python packages. to be more specific to "site-packages" folder. And it's named "cli" image The name doesn't relate to cycode at all. Any other packages named "cli" will break something due to conflicts in the file system :(

also, I want to mention, that if we want to provide a separate cyclient package we should distribute it separately on PyPi (in case we want to provide Open Source lib to communicate with our backend from a code. I mean without CLI)

That's how the tree looks now after restructuring

image But it breaks imports. @MichalBor let me know if some of our projects uses CLI by importing it directly in the code instead of interacting with command line interface

Rework of versioning is coming soon. More details in the task

👑

@doratias18 doratias18 changed the title Migrate to Poetry; fix package structure CM-22829 - Migrate to Poetry; fix package structure May 10, 2023
@MarshalX
Copy link
Contributor Author

@MarshalX I think the cycode runner use the cli as a package. @artem-fedorov correct me if im wrong

yeap. I checked it. but the version of the package is locked. Our update will not break it

@MarshalX MarshalX marked this pull request as ready for review May 11, 2023 16:58
@MarshalX MarshalX requested a review from artem-fedorov May 11, 2023 16:59
@MarshalX MarshalX changed the title CM-22829 - Migrate to Poetry; fix package structure CM-22829 - Migrate to Poetry; fix package structure; use dynamic versioning from Git Tags May 11, 2023
@MarshalX MarshalX merged commit fd73c84 into main May 12, 2023
@MarshalX MarshalX deleted the CM-22829-migrate-the-project-to-Poetry-and-rework-versioning-flow branch May 12, 2023 11:36
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