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

Add project_title in Project and create_project #21

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jwijffels
Copy link

@jwijffels jwijffels commented Nov 13, 2024

What's in the PR
Project gains attribute project_title and create_project gains argument project_title
Linked to inception-project/inception#5156

How to test manually

from pycaprio import Pycaprio
client = Pycaprio(inception_host = host, authentication = (user, password))
projects = client.api.projects()
print(projects)
projects[0].project_title

proj = client.api.create_project("hello_world", project_title = "Hello World", creator_name="other user")
proj.project_title

Automatic testing

  • PR includes unit tests

Documentation

  • PR updates documentation

@reckart reckart added this to the 0.3.0 milestone Nov 15, 2024
@reckart reckart added the ⭐️ Enhancement New feature or request label Nov 15, 2024
@reckart
Copy link
Member

reckart commented Nov 15, 2024

@jwijffels Thanks for the PR. The linter fails. Try running make lint. I thought we had a make black as well... maybe that went missing when I changed the build setup...

I think it might be helpful if the pycaprio API mapped the fields not as in the response, but rather as what they mean:

  • title -> name
  • name -> slug

WDYT?

@jwijffels
Copy link
Author

Thanks for taking over the maintenance of pycaprio!

I'll look into the linter.

About the change of title = name, name = slug, For me ok, but that's a breaking change. Not sure what is your position on breaking changes.

@reckart
Copy link
Member

reckart commented Nov 17, 2024

About the change of title = name, name = slug, For me ok, but that's a breaking change. Not sure what is your position on breaking changes.

I try to avoid them. That is why I didn't change the properties in the HTTP response JSON when I changed the name to be the slug and added the title. Because at the time, I couldn't make pycaprio releases and if I had made that change, it would have broken pycaprio for everybody.

However, we are pre-1.0.0. Also I think it is confusing if the names do not reflect the semantics.

I don't have a very strong opinion, but at some point, it needs to be changed anyway - so why not now?

If you have a better idea or different opinion, glad to hear it.

@jwijffels
Copy link
Author

My preference is to always be backwards compatible where possible to avoid breaking changes but if you intend to have a lot more changes planned, yes it makes sense to do them. This slug/name also already got me confused as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⭐️ Enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants